Fossil SCM

Revised ticket processing to align with coding style guide, and for clarity of presentation.

drh 2013-02-12 19:23 trunk
Commit 67f787dc4e2e4eab8e58943005312c90bf71dcb0
1 file changed +3 -3
+3 -3
--- src/tkt.c
+++ src/tkt.c
@@ -210,13 +210,13 @@
210210
}
211211
aUsed = fossil_malloc( nField );
212212
memset(aUsed, 0, nField);
213213
for(i=0; i<p->nField; i++){
214214
const char *zName = p->aField[i].zName;
215
- if( zName[0]!='+' && (j = fieldId(zName))<0 ) continue;
216
- if( zName[0]=='+' && (j = fieldId(zName+1))<0 )
217
- continue;
215
+ const char *zBaseName = zName[0]=='+' ? zName+1 : zName;
216
+ j = fieldId(zBaseName);
217
+ if( j<0 ) continue;
218218
aUsed[j] = 1;
219219
if( aField[j].mUsed & USEDBY_TICKET ){
220220
if( zName[0]=='+' ){
221221
zName++;
222222
blob_appendf(&sql1,", %s=coalesce(%s,'') || %Q",
223223
--- src/tkt.c
+++ src/tkt.c
@@ -210,13 +210,13 @@
210 }
211 aUsed = fossil_malloc( nField );
212 memset(aUsed, 0, nField);
213 for(i=0; i<p->nField; i++){
214 const char *zName = p->aField[i].zName;
215 if( zName[0]!='+' && (j = fieldId(zName))<0 ) continue;
216 if( zName[0]=='+' && (j = fieldId(zName+1))<0 )
217 continue;
218 aUsed[j] = 1;
219 if( aField[j].mUsed & USEDBY_TICKET ){
220 if( zName[0]=='+' ){
221 zName++;
222 blob_appendf(&sql1,", %s=coalesce(%s,'') || %Q",
223
--- src/tkt.c
+++ src/tkt.c
@@ -210,13 +210,13 @@
210 }
211 aUsed = fossil_malloc( nField );
212 memset(aUsed, 0, nField);
213 for(i=0; i<p->nField; i++){
214 const char *zName = p->aField[i].zName;
215 const char *zBaseName = zName[0]=='+' ? zName+1 : zName;
216 j = fieldId(zBaseName);
217 if( j<0 ) continue;
218 aUsed[j] = 1;
219 if( aField[j].mUsed & USEDBY_TICKET ){
220 if( zName[0]=='+' ){
221 zName++;
222 blob_appendf(&sql1,", %s=coalesce(%s,'') || %Q",
223

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button