File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
main/java/org/eclipse/store/gigamap/types
test/java/org/eclipse/store/gigamap/indexer Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -701,13 +701,25 @@ public final void ensureOptimizedPerformance()
701701 @ Override
702702 public void internalPrepareIndicesUpdate (final E replacedEntity )
703703 {
704+ if (this .bitmapIndices .isEmpty ())
705+ {
706+ // no-op
707+ return ;
708+ }
709+
704710 // Derive state handlers for the state of the replaced entity.
705711 this .createChangeHandlers (this .cachedPrevChangeHandlers , replacedEntity );
706712 }
707713
708714 @ Override
709715 public void internalFinishIndicesUpdate ()
710716 {
717+ if (this .bitmapIndices .isEmpty ())
718+ {
719+ // no-op
720+ return ;
721+ }
722+
711723 this .clearCachedChangeHandlers ();
712724 }
713725
@@ -719,6 +731,12 @@ public final void internalUpdateIndices(
719731 final CustomConstraints <? super E > customConstraints
720732 )
721733 {
734+ if (this .bitmapIndices .isEmpty ())
735+ {
736+ // no-op
737+ return ;
738+ }
739+
722740 try
723741 {
724742 // Derive state handlers for the new, potentially changed state
Original file line number Diff line number Diff line change @@ -287,6 +287,14 @@ void update()
287287 assertEquals (0 , map .query (indexer ).in (1L , 5L ).count ());
288288 }
289289
290+ @ Test
291+ void setWithNoIndex ()
292+ {
293+ final GigaMap <String > map = GigaMap .New ();
294+ final long id = map .add ("foo" );
295+ assertEquals ("foo" , map .set (id , "bar" ));
296+ }
297+
290298 @ Test
291299 void bulk ()
292300 {
You can’t perform that action at this time.
0 commit comments