[sword-svn] r3897 - trunk/src/keys
scribe at crosswire.org
scribe at crosswire.org
Mon Mar 3 08:48:49 EST 2025
Author: scribe
Date: 2025-03-03 08:48:49 -0500 (Mon, 03 Mar 2025)
New Revision: 3897
Modified:
trunk/src/keys/versekey.cpp
Log:
remove goto
Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp 2025-02-28 14:30:09 UTC (rev 3896)
+++ trunk/src/keys/versekey.cpp 2025-03-03 13:48:49 UTC (rev 3897)
@@ -582,7 +582,9 @@
lastKey->setAutoNormalize(false);
if (defaultKey) *lastKey = defaultKey;
+
while (*buf) {
+ bool gotoTerminateRange = false;
switch (*buf) {
case ':':
if (buf[1] != ' ') { // for silly "Mat 1:1: this verse...."
@@ -597,9 +599,10 @@
comma = 0;
break;
}
- goto terminate_range;
- // otherwise drop down to next case
- case ' ':
+ // otherwise drop down to terminateRange
+ gotoTerminateRange = true;
+ case ' ': if (!gotoTerminateRange) {
+
inTerm = true;
while (true) {
if ((!*number) || (chap < 0))
@@ -616,8 +619,9 @@
}
break;
}
+ }
- case '-':
+ case '-': if (!gotoTerminateRange) {
if (chap == -1) {
book[tobook] = *buf;
book[tobook+1] = *(buf+1);
@@ -629,9 +633,10 @@
break;
}
}
+ }
+// terminateRange:
case ',': // on number new verse
case ';': // on number new chapter
-terminate_range:
number[tonumber] = 0;
tonumber = 0;
if (*number) {
More information about the sword-cvs
mailing list