Changeset 4041


Ignore:
Timestamp:
Feb 15, 2021, 3:54:43 AM (4 months ago)
Author:
Peter
Message:

avoid constructing temporary substring just for comparison

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/VcfHeader.cc

    r4040 r4041  
    344344                                 const std::string& prefix) const
    345345  {
    346     return s.substr(0, prefix.size()) == prefix;
     346    return s.size() >= prefix.size() &&
     347      std::equal(prefix.begin(), prefix.end(), s.begin());
    347348  }
    348349
Note: See TracChangeset for help on using the changeset viewer.