Skip to content

Commit

Permalink
Make sure to never just override an exisiting page in the store.
Browse files Browse the repository at this point in the history
We change SoilPagedIndexStore>>#pageAt:put: to use #at:ifPresent:ifAbsentPut: to raise an error in this case
  • Loading branch information
MarcusDenker committed Nov 28, 2024
1 parent c870cfd commit 3a1cad9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Soil-Core/SoilPagedIndexStore.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ SoilPagedIndexStore >> pageAt: anInteger [

{ #category : #accessing }
SoilPagedIndexStore >> pageAt: anInteger put: aPage [

^ pagesMutex critical: [
pages
at: anInteger
put: aPage ]
ifPresent: [ self error: 'Page already there, should not happen!' ]
ifAbsentPut: aPage ]
]

{ #category : #accessing }
Expand Down

0 comments on commit 3a1cad9

Please sign in to comment.