EnumEncodedValue Parser != OTHER

When looking at a parser, for example the OSMRoadEnvironmentParser, I realized that before setting the enum there is always a check like:

if (roadEnvironment != OTHER)
    roadEnvEnc.setEnum(false, edgeFlags, roadEnvironment);

What is the reason for this check? Is it simply because OTHER is at index 0 so we don’t need to set it again to 0 so we can squeeze a tiny bit of performance? Or is there a different reason for this?

Yes, tiny performance reasons like

if(logger.isDebug)
   logger.debug(...)

as it is called millions of times on import. Not important I think

1 Like

Thanks for the clarification! That makes sense.