From e6804a16799b065c4c61bf7f4382735d30248d7d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 10 Feb 2013 08:46:19 -0500 Subject: [PATCH] UTF8 Line Extraction - Minor efficiency modification, made while fixing a bug. --- src/text.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/text.cpp b/src/text.cpp index 067404764..29146b1c8 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -326,19 +326,21 @@ void extractLine ( last_space = previous; // Record last seen comma. - if (character == ',') + else if (character == ',' || + character == ';' || + character == '.') last_comma = previous; // Newline is an early break point. - if (character == '\n') + else if (character == '\n') { - line = text.substr (0, bytes - 1); + line = text.substr (0, previous); text = text.substr (bytes); return; } // EOS is an early break point. - if (character == 0) + else if (character == 0) { line = text; text = "";