NEXUS-6277: Minimal optimization

Original PR
https://github.com/sonatype/nexus-oss/pull/354

Issue
https://issues.sonatype.org/browse/NEXUS-6277