mapping: disambiguate local variable el
Reported-by: Xcode Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
a0626f802a
commit
10c9362b4f
@ -132,19 +132,21 @@ namespace stdex
|
|||||||
return to;
|
return to;
|
||||||
|
|
||||||
size_t l, r;
|
size_t l, r;
|
||||||
const auto& el = mapping[m];
|
{
|
||||||
if (to < el.to) {
|
const auto& el = mapping[m];
|
||||||
l = 0;
|
if (to < el.to) {
|
||||||
r = m;
|
l = 0;
|
||||||
|
r = m;
|
||||||
|
}
|
||||||
|
else if (el.to < to) {
|
||||||
|
if (mapping.size() - 1 <= m || to < mapping[m + 1].to)
|
||||||
|
return el.from + (to - el.to);
|
||||||
|
l = m + 1;
|
||||||
|
r = mapping.size();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return el.from;
|
||||||
}
|
}
|
||||||
else if (el.to < to) {
|
|
||||||
if (mapping.size() - 1 <= m || to < mapping[m + 1].to)
|
|
||||||
return el.from + (to - el.to);
|
|
||||||
l = m + 1;
|
|
||||||
r = mapping.size();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return el.from;
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (l < r) {
|
if (l < r) {
|
||||||
@ -214,19 +216,21 @@ namespace stdex
|
|||||||
return from;
|
return from;
|
||||||
|
|
||||||
size_t l, r;
|
size_t l, r;
|
||||||
const auto& el = mapping[m];
|
{
|
||||||
if (from < el.from) {
|
const auto& el = mapping[m];
|
||||||
l = 0;
|
if (from < el.from) {
|
||||||
r = m;
|
l = 0;
|
||||||
|
r = m;
|
||||||
|
}
|
||||||
|
else if (el.from < from) {
|
||||||
|
if (mapping.size() - 1 <= m || from < mapping[m + 1].from)
|
||||||
|
return el.to + (from - el.from);
|
||||||
|
l = m + 1;
|
||||||
|
r = mapping.size();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return el.to;
|
||||||
}
|
}
|
||||||
else if (el.from < from) {
|
|
||||||
if (mapping.size() - 1 <= m || from < mapping[m + 1].from)
|
|
||||||
return el.to + (from - el.from);
|
|
||||||
l = m + 1;
|
|
||||||
r = mapping.size();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return el.to;
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (l < r) {
|
if (l < r) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user