Walt Karas
2018-10-26 22:21:42 UTC
This line of code:
https://github.com/apache/trafficserver/blob/master/iocore/net/SSLSNIConfig.cc#L59
should be:
for (const auto &item : Y_sni.items) {
This causes item to be of type const Item & instead of Item. Thus
avoiding making a copy of each element in the vector. Look at this
example code:
https://godbolt.org/z/7j0LFT
Note in the assembler code how foo() calls the copy constructor for
Item in the for loop, and foo2() does not.
https://github.com/apache/trafficserver/blob/master/iocore/net/SSLSNIConfig.cc#L59
should be:
for (const auto &item : Y_sni.items) {
This causes item to be of type const Item & instead of Item. Thus
avoiding making a copy of each element in the vector. Look at this
example code:
https://godbolt.org/z/7j0LFT
Note in the assembler code how foo() calls the copy constructor for
Item in the for loop, and foo2() does not.