3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00
This commit is contained in:
Nikolaj Bjorner 2023-02-16 08:53:08 -08:00
parent 7c08e53e94
commit 554a9e8efe

View file

@ -214,7 +214,8 @@ int zstring::indexofu(zstring const& other, unsigned offset) const {
} }
int zstring::last_indexof(zstring const& other) const { int zstring::last_indexof(zstring const& other) const {
if (other.length() == 0) return length(); if (length() == 0 && other.length() == 0) return 0;
if (other.length() == 0) return -1;
if (other.length() > length()) return -1; if (other.length() > length()) return -1;
for (unsigned last = length() - other.length() + 1; last-- > 0; ) { for (unsigned last = length() - other.length() + 1; last-- > 0; ) {
bool suffix = true; bool suffix = true;