-
Notifications
You must be signed in to change notification settings - Fork 62
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
RealmDictionary
- 6b: allow comparison of ByteArray
values by content
#1254
Merged
edualonso
merged 98 commits into
el/dictionary-feature
from
el/dictionary-6b-revisited-comparison-semantics-for-bytearray
Feb 1, 2023
Merged
RealmDictionary
- 6b: allow comparison of ByteArray
values by content
#1254
edualonso
merged 98 commits into
el/dictionary-feature
from
el/dictionary-6b-revisited-comparison-semantics-for-bytearray
Feb 1, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tAll, remove and clear for all types except RealmAny
…ggested during code review
…y-3-entryset # Conflicts: # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/RealmDictionaryExt.kt # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmMapInternal.kt # packages/test-base/src/androidAndroidTest/kotlin/io/realm/kotlin/test/shared/RealmDictionaryTests.kt
…underlying dictionary is modified in any way while iterating
…and added tests for setting new values to managed entries
…ove-clear # Conflicts: # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/RealmDictionaryExt.kt # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmMapInternal.kt # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectHelper.kt # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmMap.kt
…ove-clear # Conflicts: # packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/TypeDescriptor.kt
# Conflicts: # packages/cinterop/src/nativeDarwin/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/RealmDictionaryExt.kt # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmMapInternal.kt # packages/test-base/src/androidAndroidTest/kotlin/io/realm/kotlin/test/shared/RealmDictionaryTests.kt
# Conflicts: # packages/test-base/src/androidAndroidTest/kotlin/io/realm/kotlin/test/shared/RealmDictionaryTests.kt
cmelchior
approved these changes
Jan 31, 2023
if (classifier != ByteArray::class && classifier != RealmObject::class) { | ||
// Ignore RealmObject: structural equality cannot be assessed for this type when removing | ||
// entries from the entry set | ||
if (classifier != RealmObject::class) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After talking. We should add a TODO linking to #1097
…b-revisited-comparison-semantics-for-bytearray
…b-revisited-comparison-semantics-for-bytearray
…b-revisited-comparison-semantics-for-bytearray
# Conflicts: # packages/test-base/src/androidAndroidTest/kotlin/io/realm/kotlin/test/shared/RealmDictionaryTests.kt
…b-revisited-comparison-semantics-for-bytearray
…ects # Conflicts: # packages/test-base/src/androidAndroidTest/kotlin/io/realm/kotlin/test/shared/RealmDictionaryTests.kt
…b-revisited-comparison-semantics-for-bytearray
…b-revisited-comparison-semantics-for-bytearray
…d-keys # Conflicts: # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmMapInternal.kt
…b-revisited-comparison-semantics-for-bytearray
Base automatically changed from
el/dictionary-6-contains-and-keys
to
el/dictionary-feature
February 1, 2023 16:24
…comparison-semantics-for-bytearray # Conflicts: # packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmMapInternal.kt # packages/test-base/src/androidAndroidTest/kotlin/io/realm/kotlin/test/shared/RealmDictionaryTests.kt
edualonso
deleted the
el/dictionary-6b-revisited-comparison-semantics-for-bytearray
branch
February 1, 2023 18:43
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Revisited logic to allow comparison of byte arrays at structural level to facilitate remove operations on
Map.values
,Map.entries
.Pull request plan:
RealmMap
andRealmDictionary
interfaces and associated helper functions (stubs)copyToRealm
for objects with dictionaries and interface functionsget
,put
,putAll
,remove
andclear
for all types exceptRealmAny
(it will be done once the interface implementation is complete)entries
(i.e.RealmMapEntrySet
,UnmanagedRealmMapEntry
andManagedRealmMapEntry
) and internal entry set iterator (which enables iterating through the dictionary's k-v pairs externally)containsKey
,containsValue
- currently missing support in the C-API ([C-API] - add support forDictionary::get_keys()
,Dictionary::contains(StringData key)
andDictionary::find_any(Mixed value)
realm-core#6181)values
- this change entails refactoringRealmResults
to contain primitive valuesRealmAny
(dictionaries don't own objects like sets and lists do so removing them from the dictionary won't remove them from the realm)Deleteable
andasFlow
- currently blocked by [C-API]realm_dictionary_add_notification_callback
does not return the actual keys of the values that change realm-core#6228ByteArray
s to be compared structurally to allowremove
operations on entry set and valuescopyFromRealm