commit 752c67ada941fdbb6f83311face094fde3ea8924
Author: Scott Kostyshak <[email protected]>
Date: Fri Dec 18 21:58:22 2015 -0500
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.
diff --git a/src/Text.cpp b/src/Text.cpp
index 80babde..fe59cb3 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -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());