Fossil SCM
Improved locality of a variable. No functional change.
Commit
09103fd2f0c7fca6cdab73ee0dbcb39b71693b4ad7e301d0c940febba0a3c543
Parent
8f47c3f653d87d5…
1 file changed
+2
-3
+2
-3
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -951,11 +951,10 @@ | ||
| 951 | 951 | " GROUP BY froot ORDER BY 1 LIMIT %d OFFSET %d;", |
| 952 | 952 | iLimit+1, iOfst |
| 953 | 953 | ); |
| 954 | 954 | while( db_step(&q)==SQLITE_ROW ){ |
| 955 | 955 | char *zAge = human_readable_age(db_column_double(&q,0)); |
| 956 | - char *zDuration = 0; | |
| 957 | 956 | int nMsg = db_column_int(&q, 2); |
| 958 | 957 | const char *zUuid = db_column_text(&q, 3); |
| 959 | 958 | const char *zTitle = db_column_text(&q, 4); |
| 960 | 959 | if( iCnt==0 ){ |
| 961 | 960 | if( iOfst>0 ){ |
| @@ -986,16 +985,16 @@ | ||
| 986 | 985 | @ <tr><td>%h(zAge) ago</td> |
| 987 | 986 | @ <td>%z(href("%R/forumpost/%S",zUuid))%h(zTitle)</a></td> |
| 988 | 987 | if( nMsg<2 ){ |
| 989 | 988 | @ <td>no replies</td> |
| 990 | 989 | }else{ |
| 991 | - zDuration = human_readable_age(db_column_double(&q,1)); | |
| 990 | + char *zDuration = human_readable_age(db_column_double(&q,1)); | |
| 992 | 991 | @ <td>%d(nMsg) posts spanning %h(zDuration)</td> |
| 992 | + fossil_free(zDuration); | |
| 993 | 993 | } |
| 994 | 994 | @ </tr> |
| 995 | 995 | fossil_free(zAge); |
| 996 | - fossil_free(zDuration); | |
| 997 | 996 | } |
| 998 | 997 | db_finalize(&q); |
| 999 | 998 | } |
| 1000 | 999 | if( iCnt>0 ){ |
| 1001 | 1000 | @ </table></div> |
| 1002 | 1001 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -951,11 +951,10 @@ | |
| 951 | " GROUP BY froot ORDER BY 1 LIMIT %d OFFSET %d;", |
| 952 | iLimit+1, iOfst |
| 953 | ); |
| 954 | while( db_step(&q)==SQLITE_ROW ){ |
| 955 | char *zAge = human_readable_age(db_column_double(&q,0)); |
| 956 | char *zDuration = 0; |
| 957 | int nMsg = db_column_int(&q, 2); |
| 958 | const char *zUuid = db_column_text(&q, 3); |
| 959 | const char *zTitle = db_column_text(&q, 4); |
| 960 | if( iCnt==0 ){ |
| 961 | if( iOfst>0 ){ |
| @@ -986,16 +985,16 @@ | |
| 986 | @ <tr><td>%h(zAge) ago</td> |
| 987 | @ <td>%z(href("%R/forumpost/%S",zUuid))%h(zTitle)</a></td> |
| 988 | if( nMsg<2 ){ |
| 989 | @ <td>no replies</td> |
| 990 | }else{ |
| 991 | zDuration = human_readable_age(db_column_double(&q,1)); |
| 992 | @ <td>%d(nMsg) posts spanning %h(zDuration)</td> |
| 993 | } |
| 994 | @ </tr> |
| 995 | fossil_free(zAge); |
| 996 | fossil_free(zDuration); |
| 997 | } |
| 998 | db_finalize(&q); |
| 999 | } |
| 1000 | if( iCnt>0 ){ |
| 1001 | @ </table></div> |
| 1002 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -951,11 +951,10 @@ | |
| 951 | " GROUP BY froot ORDER BY 1 LIMIT %d OFFSET %d;", |
| 952 | iLimit+1, iOfst |
| 953 | ); |
| 954 | while( db_step(&q)==SQLITE_ROW ){ |
| 955 | char *zAge = human_readable_age(db_column_double(&q,0)); |
| 956 | int nMsg = db_column_int(&q, 2); |
| 957 | const char *zUuid = db_column_text(&q, 3); |
| 958 | const char *zTitle = db_column_text(&q, 4); |
| 959 | if( iCnt==0 ){ |
| 960 | if( iOfst>0 ){ |
| @@ -986,16 +985,16 @@ | |
| 985 | @ <tr><td>%h(zAge) ago</td> |
| 986 | @ <td>%z(href("%R/forumpost/%S",zUuid))%h(zTitle)</a></td> |
| 987 | if( nMsg<2 ){ |
| 988 | @ <td>no replies</td> |
| 989 | }else{ |
| 990 | char *zDuration = human_readable_age(db_column_double(&q,1)); |
| 991 | @ <td>%d(nMsg) posts spanning %h(zDuration)</td> |
| 992 | fossil_free(zDuration); |
| 993 | } |
| 994 | @ </tr> |
| 995 | fossil_free(zAge); |
| 996 | } |
| 997 | db_finalize(&q); |
| 998 | } |
| 999 | if( iCnt>0 ){ |
| 1000 | @ </table></div> |
| 1001 |