mongo-c-driver icon indicating copy to clipboard operation
mongo-c-driver copied to clipboard

Replace custom null check with strlen

Open adriandole opened this issue 1 year ago • 0 comments

strlen is faster than a manual loop and will be optimized away for compile-time strings.

Use less-than rather than equality to preserve the behavior where the user can get the first x characters of a string by setting a shorter length.

adriandole avatar Dec 28 '23 21:12 adriandole