Skip to content

Release 0.6.1 #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.6.1] - 2024-11-01

**Fix**:
- Fixed an issue that would crash the execution when calling *Remove()* & *RemoveOrigin* from *ObservableResolverDictionary*

Comment on lines +7 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The changelog entry for Release 0.6.1 is missing the release date. Please update it to include the correct date.

## [0.6.1] - 2024-11-01

**Fix**:
- Fixed an issue that would crash the execution when calling *Remove()* & *RemoveOrigin* from *ObservableResolverDictionary*

## [0.6.0] - 2023-08-05

- Improved the *ObservableResolverList* and *ObservableResolverDictionary* data types to properly resolve lists and dictionaries with different data types from the original collection.
Comment on lines 4 to 14
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Note: This review was outside of the patch, but no patch was found that overlapped with it. Original lines [22-22]

There's a syntax error in the add function.

-    retrn z
+    return z

Expand Down
8 changes: 6 additions & 2 deletions Runtime/ObservableDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,9 @@ public override void Add(TKey key, TValue value)
/// <inheritdoc />
public override bool Remove(TKey key)
{
var pair = _toOrignResolver(key, Dictionary[key]);
if(!Dictionary.TryGetValue(key, out var value)) return false;

var pair = _toOrignResolver(key, value);
Comment on lines +456 to +458
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The code change in this section updates the Remove method in the ObservableResolverDictionary class. The modification introduces a check using TryGetValue to handle cases where the key is not found in the dictionary. This is an improvement as it prevents an exception from being thrown when attempting to access a non-existent key.


_dictionary.Remove(pair.Key);

Expand All @@ -479,7 +481,9 @@ public void AddOrigin(TKeyOrigin key, TValueOrigin value)
/// <inheritdoc />
public bool RemoveOrigin(TKeyOrigin key)
{
var convertPair = _fromOrignResolver(new KeyValuePair<TKeyOrigin, TValueOrigin>(key, OriginDictionary[key]));
if (!_dictionary.TryGetValue(key, out var value)) return false;

var convertPair = _fromOrignResolver(new KeyValuePair<TKeyOrigin, TValueOrigin>(key, value));

_dictionary.Remove(key);
return base.Remove(convertPair.Key);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "com.gamelovers.dataextensions",
"displayName": "Unity Data Type Extensions",
"author": "Miguel Tomas",
"version": "0.6.0",
"unity": "2022.4",
"version": "0.6.1",
"unity": "2022.3",
"license": "MIT",
"description": "This package extends various sets of data types to be used in any type of data containers or persistent serializable data",
"type": "library",
Expand Down
Loading