Issue Task Closed

#54091Use === operator instead of strlen() to check for zero length strings

Markus Klein 11/29/13, 17:00 updated 10/02/18, 12:09

Description

Use the === operator instead of the strlen() function to check for strings of length zero.

This can give a performance improvement of factor 3.

Short note: Although some source claim that strlen() has O(1), for some reason the comparison against an empty string is still faster.

Nevertheless, besides the possible performance improvement, this change also improves readability.

Reviews 7