forked from lix-project/lix
libexpr: unbreak PosTable performance
this was mostly an inconvenience for error reporting, but fully broke
the debugger (because the debugger does *a lot* of eager position
resolution). copying the line offsets into a local and filling that
local when empty without also storing the calculated offsets back does
kind of ... not cache anything.
fixes lix-project/lix#165
Change-Id: Iccb0ba193ce2f15c832978daecf7b9bebbbe8585
This commit is contained in:
parent
e965ea476e
commit
fff1fbe6aa
|
@ -593,7 +593,7 @@ Pos PosTable::operator[](PosIdx p) const
|
||||||
|
|
||||||
Pos result{0, 0, origin->origin};
|
Pos result{0, 0, origin->origin};
|
||||||
auto lines = this->lines.lock();
|
auto lines = this->lines.lock();
|
||||||
auto linesForInput = (*lines)[origin->offset];
|
auto & linesForInput = (*lines)[origin->offset];
|
||||||
|
|
||||||
if (linesForInput.empty()) {
|
if (linesForInput.empty()) {
|
||||||
auto source = result.getSource().value_or("");
|
auto source = result.getSource().value_or("");
|
||||||
|
|
Loading…
Reference in a new issue