BugZero found this defect 52 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/28/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
This is an antipattern because it makes us go through the BSON object twice: if (obj.hasElement(elemName)) { elem = obj["elemName"] doStuff(elem); } Instead it should be: elem = obj["elemName"] if (!elem.eoo()) { doStuff(elem); } We do this in several places in our codebase, such as here, here, here, etc. While some of the examples I listed are not on the hot path, it would help if we got rid of this idiom altogether so that it stops spreading. See comments for more info.