From 752c67ada941fdbb6f83311face094fde3ea8924 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Fri, 18 Dec 2015 21:58:22 -0500 Subject: [PATCH] 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. --- src/Text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text.cpp b/src/Text.cpp index 80babde39a..fe59cb3f71 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()); -- 2.39.2