java-user-agent-detection icon indicating copy to clipboard operation
java-user-agent-detection copied to clipboard

[Performance] Using a default instance (like EMPTY) on to reduce object creation of UserAgentDetectionResult

Open trinhnx opened this issue 4 years ago • 0 comments

When UserAgentDetector.parseUserAgent() with null or short header, it returns an empty result which has default value. IMHO, this value could be served as a Static instance to reduce the creation. Moreover, the Device, Bot, Locale, OS or Browser also have the empty instance.

trinhnx avatar Aug 13 '21 16:08 trinhnx