mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
Do not initialize a var to a val that's never used
By initializing 'to' to a value, the code made it seem like that value mattered. But the value is overwritten in getWord(). Further, now if 'to' is used before it is initialized, there might be a useful compiler warning that could point to a bug.
This commit is contained in:
parent
7dd7980720
commit
752c67ada9
@ -1266,7 +1266,7 @@ void Text::selectWord(Cursor & cur, word_location loc)
|
|||||||
{
|
{
|
||||||
LBUFERR(this == cur.text());
|
LBUFERR(this == cur.text());
|
||||||
CursorSlice from = cur.top();
|
CursorSlice from = cur.top();
|
||||||
CursorSlice to = cur.top();
|
CursorSlice to;
|
||||||
getWord(from, to, loc);
|
getWord(from, to, loc);
|
||||||
if (cur.top() != from)
|
if (cur.top() != from)
|
||||||
setCursor(cur, from.pit(), from.pos());
|
setCursor(cur, from.pit(), from.pos());
|
||||||
|
Loading…
Reference in New Issue
Block a user