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:
Scott Kostyshak 2015-12-18 21:58:22 -05:00
parent 7dd7980720
commit 752c67ada9

View File

@ -1266,7 +1266,7 @@ void Text::selectWord(Cursor & cur, word_location loc)
{
LBUFERR(this == cur.text());
CursorSlice from = cur.top();
CursorSlice to = cur.top();
CursorSlice to;
getWord(from, to, loc);
if (cur.top() != from)
setCursor(cur, from.pit(), from.pos());