Fossil

Check-in [09103fd2]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improved locality of a variable. No functional change.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:09103fd2f0c7fca6cdab73ee0dbcb39b71693b4ad7e301d0c940febba0a3c543
User & Date: wyoung 2018-08-16 07:21:21
Context
2018-08-16
12:31
Fix the /forum page so that it links to the most recent post. check-in: b0ae37c0 user: drh tags: trunk
07:21
Improved locality of a variable. No functional change. check-in: 09103fd2 user: wyoung tags: trunk
06:36
Replaced a declare-and-init line pair with a single define-with-value line. No functional change. check-in: 8f47c3f6 user: wyoung tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/forum.c.

949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
...
984
985
986
987
988
989
990
991
992

993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
      "                              ORDER BY fmtime DESC LIMIT 1))"
      " FROM forumpost AS x"
      " GROUP BY froot ORDER BY 1 LIMIT %d OFFSET %d;",
      iLimit+1, iOfst
    );
    while( db_step(&q)==SQLITE_ROW ){
      char *zAge = human_readable_age(db_column_double(&q,0));
      char *zDuration = 0;
      int nMsg = db_column_int(&q, 2);
      const char *zUuid = db_column_text(&q, 3);
      const char *zTitle = db_column_text(&q, 4);
      if( iCnt==0 ){
        if( iOfst>0 ){
          @ <h1>Threads at least %s(zAge) old</h1>
        }else{
................................................................................
        break;
      }
      @ <tr><td>%h(zAge) ago</td>
      @ <td>%z(href("%R/forumpost/%S",zUuid))%h(zTitle)</a></td>
      if( nMsg<2 ){
        @ <td>no replies</td>
      }else{
        zDuration = human_readable_age(db_column_double(&q,1));
        @ <td>%d(nMsg) posts spanning %h(zDuration)</td>

      }
      @ </tr>
      fossil_free(zAge);
      fossil_free(zDuration);
    }
    db_finalize(&q);
  }
  if( iCnt>0 ){
    @ </table></div>
  }else{
    @ <h1>No forum posts found</h1>
  }
  style_footer();
}







<







 







|

>



<










949
950
951
952
953
954
955

956
957
958
959
960
961
962
...
983
984
985
986
987
988
989
990
991
992
993
994
995

996
997
998
999
1000
1001
1002
1003
1004
1005
      "                              ORDER BY fmtime DESC LIMIT 1))"
      " FROM forumpost AS x"
      " GROUP BY froot ORDER BY 1 LIMIT %d OFFSET %d;",
      iLimit+1, iOfst
    );
    while( db_step(&q)==SQLITE_ROW ){
      char *zAge = human_readable_age(db_column_double(&q,0));

      int nMsg = db_column_int(&q, 2);
      const char *zUuid = db_column_text(&q, 3);
      const char *zTitle = db_column_text(&q, 4);
      if( iCnt==0 ){
        if( iOfst>0 ){
          @ <h1>Threads at least %s(zAge) old</h1>
        }else{
................................................................................
        break;
      }
      @ <tr><td>%h(zAge) ago</td>
      @ <td>%z(href("%R/forumpost/%S",zUuid))%h(zTitle)</a></td>
      if( nMsg<2 ){
        @ <td>no replies</td>
      }else{
        char *zDuration = human_readable_age(db_column_double(&q,1));
        @ <td>%d(nMsg) posts spanning %h(zDuration)</td>
        fossil_free(zDuration);
      }
      @ </tr>
      fossil_free(zAge);

    }
    db_finalize(&q);
  }
  if( iCnt>0 ){
    @ </table></div>
  }else{
    @ <h1>No forum posts found</h1>
  }
  style_footer();
}