mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
fir #5856
This commit is contained in:
parent
14ee02183c
commit
f66b4f0880
|
@ -216,7 +216,7 @@ 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 (other.length() == 0) return length();
|
||||||
if (other.length() > length()) return -1;
|
if (other.length() > length()) return -1;
|
||||||
for (unsigned last = length() - other.length(); last-- > 0; ) {
|
for (unsigned last = length() - other.length() + 1; last-- > 0; ) {
|
||||||
bool suffix = true;
|
bool suffix = true;
|
||||||
for (unsigned j = 0; suffix && j < other.length(); ++j) {
|
for (unsigned j = 0; suffix && j < other.length(); ++j) {
|
||||||
suffix = m_buffer[last + j] == other[j];
|
suffix = m_buffer[last + j] == other[j];
|
||||||
|
|
Loading…
Reference in a new issue