3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 10:25:18 +00:00

Merge pull request #1467 from waywardmonkeys/use-char-rfind

Use char version of rfind.
This commit is contained in:
Nikolaj Bjorner 2018-01-30 08:41:23 -08:00 committed by GitHub
commit 54ba25175c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -614,7 +614,7 @@ namespace datalog {
std::string get_file_name_without_extension(std::string name) {
size_t slash_index = name.find_last_of("\\/");
size_t dot_index = name.rfind(".");
size_t dot_index = name.rfind('.');
size_t ofs = (slash_index==std::string::npos) ? 0 : slash_index+1;
size_t count = (dot_index!=std::string::npos && dot_index>ofs) ?
(dot_index-ofs) : std::string::npos;