diff --git a/src/Soil-Core-Tests/SoilIndexedDictionaryTest.class.st b/src/Soil-Core-Tests/SoilIndexedDictionaryTest.class.st index 462aa254..87cd9796 100644 --- a/src/Soil-Core-Tests/SoilIndexedDictionaryTest.class.st +++ b/src/Soil-Core-Tests/SoilIndexedDictionaryTest.class.st @@ -265,40 +265,6 @@ SoilIndexedDictionaryTest >> testDoWithTransAction [ ] -{ #category : #tests } -SoilIndexedDictionaryTest >> testFirstAssociationWithTransaction [ - | tx tx2 | - tx := soil newTransaction. - tx root: dict. - dict at: #one put: #onevalue. - dict at: #two put: #twovalue. - tx commit. - "open a second transaction ..." - tx2 := soil newTransaction. - "and test last" - self assert: tx2 root firstAssociation value equals: #onevalue. - -] - -{ #category : #tests } -SoilIndexedDictionaryTest >> testFirstAssociationWithTransactionRemoved [ - | tx tx1 tx2 | - tx := soil newTransaction. - tx root: dict. - dict at: #one put: #onevalue. - dict at: #two put: #twovalue. - tx commit. - - "open a two transactions ..." - tx1 := soil newTransaction. - tx2 := soil newTransaction. - tx2 root removeKey: #one. - tx2 commit. - "in tx1 the removed one is not removed" - self assert: tx1 root firstAssociation value equals: #onevalue. - -] - { #category : #tests } SoilIndexedDictionaryTest >> testFirstWithTransaction [ | tx tx2 | @@ -419,40 +385,6 @@ SoilIndexedDictionaryTest >> testIsEmpty [ self deny: tx1 root isEmpty. ] -{ #category : #tests } -SoilIndexedDictionaryTest >> testLastAssociationWithTransaction [ - | tx tx2 | - tx := soil newTransaction. - tx root: dict. - dict at: #two put: #twovalue. - dict at: #one put: #onevalue. - - tx commit. - "open a second transaction ..." - tx2 := soil newTransaction. - "and test last, not: key order" - self assert: tx2 root lastAssociation value equals: #twovalue -] - -{ #category : #tests } -SoilIndexedDictionaryTest >> testLastAssociationWithTransactionRemoved [ - | tx tx1 tx2 | - tx := soil newTransaction. - tx root: dict. - dict at: #one put: #onevalue. - dict at: #two put: #twovalue. - tx commit. - - "open a two transactions ..." - tx1 := soil newTransaction. - tx2 := soil newTransaction. - tx2 root removeKey: #two. - tx2 commit. - "in tx1 the removed one is not removed" - self assert: tx1 root lastAssociation value equals: #twovalue. - -] - { #category : #tests } SoilIndexedDictionaryTest >> testLastWithTransaction [ | tx tx2 | @@ -518,20 +450,6 @@ SoilIndexedDictionaryTest >> testNextAfterWithTransaction [ self assert: (tx2 root nextAfter: #one) value equals: #twovalue ] -{ #category : #tests } -SoilIndexedDictionaryTest >> testNextAssociationAfterWithTransaction [ - | tx tx2 | - tx := soil newTransaction. - tx root: dict. - dict at: #one put: #onevalue. - dict at: #two put: #twovalue. - tx commit. - "open a second transaction ..." - tx2 := soil newTransaction. - "and test last" - self assert: (tx2 root nextAssociationAfter: #one) value equals: #twovalue -] - { #category : #tests } SoilIndexedDictionaryTest >> testNextKeyCloseToWithTransaction [ | tx tx2 | diff --git a/src/Soil-Core/SoilIndexIterator.class.st b/src/Soil-Core/SoilIndexIterator.class.st index 309b5796..9e471260 100644 --- a/src/Soil-Core/SoilIndexIterator.class.st +++ b/src/Soil-Core/SoilIndexIterator.class.st @@ -266,6 +266,11 @@ SoilIndexIterator >> next: anInteger [ ^ result ] +{ #category : #accessing } +SoilIndexIterator >> nextAfter: key [ + ^ (self nextAssociationAfter: key) value +] + { #category : #accessing } SoilIndexIterator >> nextAssociation [ "Note: key will be binary key" diff --git a/src/Soil-Core/SoilIndexedDictionary.class.st b/src/Soil-Core/SoilIndexedDictionary.class.st index 3b7ad609..1e9ce5ea 100644 --- a/src/Soil-Core/SoilIndexedDictionary.class.st +++ b/src/Soil-Core/SoilIndexedDictionary.class.st @@ -92,13 +92,6 @@ SoilIndexedDictionary >> first: anInteger [ self proxyFromByteArray: each ] ] -{ #category : #accessing } -SoilIndexedDictionary >> firstAssociation [ - "Note: key will be binary key" - ^ self newIterator firstAssociation ifNotNil: [ :assoc | - assoc key -> (transaction objectWithId: assoc value asSoilObjectId) ] -] - { #category : #testing } SoilIndexedDictionary >> hasIndexUpdates [ self isRegistered ifFalse: [ ^ true ]. @@ -146,14 +139,6 @@ SoilIndexedDictionary >> last [ ] -{ #category : #accessing } -SoilIndexedDictionary >> lastAssociation [ - "Note: key will be binary key" - ^ self newIterator lastAssociation ifNotNil: [ :assoc | - assoc key -> (transaction objectWithId: assoc value asSoilObjectId) ] - -] - { #category : #private } SoilIndexedDictionary >> loadFrom: aFileReference [ ^ SoilSkipList new @@ -177,16 +162,7 @@ SoilIndexedDictionary >> newIterator [ { #category : #accessing } SoilIndexedDictionary >> nextAfter: key [ - ^ (self nextAssociationAfter: key) value - -] - -{ #category : #accessing } -SoilIndexedDictionary >> nextAssociationAfter: key [ - "Note: key will be binary key" - ^ (self newIterator nextAssociationAfter: key) - ifNotNil: [ :assoc | - assoc key -> (transaction objectWithId: assoc value asSoilObjectId) ] + ^ self proxyFromByteArray: (self newIterator nextAfter: key) value ] { #category : #private }