Closed rixed closed 7 years ago
Thanks, @rixed!
I like the direction of the patch, but there is one problem: the macro is titled "IS_EMPTY()" while it does the opposite. Can you please revise that? I also notice that in all these cases we check for NULL first which is duplicate code and should be extracted into an inline function or a macro. Finally, AppVeyor CI failed (not your fault) so this pull req should be updated.
Regarding the name of the macro, a coworker notified my already of this and I updated the patch.
Regarding the NULL I considered to include it in the macro but I'd prefered to not hide the check. Maybe a poor choice (Unfortunately I haven't written C for a while now and my judgment may not be that good any more :)) WDYT?
Merged! Thanks!
Do not compute the full string length just to find out if the string is empty or not!
This makes parsing of large input strings very slow. For instance, 20 minutes for aqq 12MiB string.
Maybe what caused this (old) bug: https://rt.cpan.org/Public/Bug/Display.html?id=84519