]> sourceware.org Git - libabigail.git/commit
Remove assertion with side-effects
authorJonathan Wakely <jwakely@redhat.com>
Tue, 10 Apr 2018 14:22:56 +0000 (15:22 +0100)
committerDodji Seketeli <dodji@redhat.com>
Mon, 16 Apr 2018 11:52:47 +0000 (13:52 +0200)
commit882288004af83291528e0644846cec7a91f66aaf
tree551da75166eeaadbe7127dd4bd5beb0ccaf84a42
parent733f1b5c1e595f503cad762fb5f24db2a47098f8
Remove assertion with side-effects

Calling assert(split_string(...)) won't do anything when NDEBUG is
defined, but the split_string call can be avoided anyway.

Since only the first result from the split string is needed, and
remove_trailing_white_spaces will trim white space anyway, the overhead
of parsing it into a vector can be avoided by using std::string::substr
directly. Additionally, calling std::string::find with a single char is
more efficient than with a string.

* src/abg-tools-utils.cc (get_dsos_provided_by_rpm): Fix
std::string::sbustr and remove assert with side effect.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-tools-utils.cc
This page took 0.027744 seconds and 5 git commands to generate.