Closed esabol closed 7 months ago
@SpamapS wrote:
Agree with your assessment. Remove that extra check. It might even get optimized out in some cases.
Yeah, I think it would be with any good compiler. OK, I've removed the if (argv) { ... }
as well. Squashed and rebased.
This PR fixes an "issue" reported by the CodeQL scan of the gearmand source code. The null check on line 179 of libtest/server.cc is redundant because it has already been dereferenced on line 177 in the condition of the![Screen Shot 2023-11-12 at 6 33 05 PM](https://github.com/gearman/gearmand/assets/22986767/ba6b22f6-cf68-48a9-a460-ce7888377917)
for
loop.I suppose the
if (argv) { ... }
around thefor
loop could also be removed since the new condition of thefor
loop will also test this, but it doesn't do any harm and arguably improves clarity. I'd be willing to remove it though if you think it should be removed, @SpamapS.