summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2024-05-07 20:45:54 (GMT)
committersebres <sebres@users.sourceforge.net>2024-05-07 20:45:54 (GMT)
commit7eb7a346c38947ee1519c84274adf071762205fd (patch)
treea8e2ff5afae02635d135c168ae83556c2761664d
parentcdbaf8e74d60061a08cc3aef5953ac83c0b977c3 (diff)
downloadtcl-7eb7a346c38947ee1519c84274adf071762205fd.zip
tcl-7eb7a346c38947ee1519c84274adf071762205fd.tar.gz
tcl-7eb7a346c38947ee1519c84274adf071762205fd.tar.bz2
more simplifications
-rw-r--r--generic/tclClockFmt.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/generic/tclClockFmt.c b/generic/tclClockFmt.c
index b08dc72..392574c 100644
--- a/generic/tclClockFmt.c
+++ b/generic/tclClockFmt.c
@@ -2294,13 +2294,12 @@ ClockGetOrParseScanFormat(
}
word_tok:
{
- ClockScanToken *wordTok = tok;
+ /* try continue with previous word token */
+ ClockScanToken *wordTok = tok - 1;
- if (tok > scnTok && (tok - 1)->map == &ScnWordTokenMap) {
- /* further with previous word token */
- wordTok = tok - 1;
- } else {
- /* new word token */
+ if (wordTok < scnTok || wordTok->map != &ScnWordTokenMap) {
+ /* start with new word token */
+ wordTok = tok;
wordTok->tokWord.start = p;
wordTok->map = &ScnWordTokenMap;
}
@@ -3338,11 +3337,12 @@ ClockGetOrParseFmtFormat(
default:
word_tok:
{
- ClockFormatToken *wordTok = tok;
+ /* try continue with previous word token */
+ ClockFormatToken *wordTok = tok - 1;
- if (tok > fmtTok && (tok - 1)->map == &FmtWordTokenMap) {
- wordTok = tok - 1;
- } else {
+ if (wordTok < fmtTok || wordTok->map != &FmtWordTokenMap) {
+ /* start with new word token */
+ wordTok = tok;
wordTok->tokWord.start = p;
wordTok->map = &FmtWordTokenMap;
}