RFC: deb/ddeb support for debuginfod

Florian Weimer fweimer@redhat.com
Mon Dec 2 07:56:00 GMT 2019


* Frank Ch. Eigler:

> +inline bool
> +string_endswith(const string& haystack, const string& needle)
> +{
> +  return (haystack.size() >= needle.size() &&
> +	  haystack.substr(haystack.size()-needle.size()) == needle);
> +}

I think you should use std::equal because substr allocations.  So
something loke htos:

  return (haystack.size() >= needle.size()
          && std::equal(haystack.end() - needle.size(), haystack.end(),
                        needle.begin(), needle.end()));



More information about the Elfutils-devel mailing list