[squid-dev] [PATCH] Refactor wordlist to SBufList in acl/RegexData
Alex Rousskov
rousskov at measurement-factory.com
Thu Oct 27 04:10:21 UTC 2016
On 10/26/2016 05:18 PM, Kinkie wrote:
>>> the attached patch refactors the use of wordlist to SBufList in
>>> acl/RegexData.cc
> - while (wl != NULL) {
> + for (SBuf i : sl) {
If possible, please avoid creating new SBufs by declaring "i" to be a
constant reference to SBuf. It is probably possible unless you modify
"i" -- I cannot tell for sure by looking at all the "i"s in the patch.
Renaming "i" to something longer and more informative like
"patternOrOption" or even "slowPatternOrOption" would be useful for
those who try to understand what is going on and/or have to find that
variable in a text full of other "i"s.
> + for (auto i : sl) {
Same here, on all counts. Auto does not automatically adds "&" or "const".
What is the time difference in configuring, for example, one million of
regexes using patched and unpatched code?
I have not reviewed the patch closely. I have no objections.
Thank you,
Alex.
More information about the squid-dev
mailing list