Check-in [edea06eec7]
Not logged in

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

Overview
SHA1 Hash:edea06eec729abc37f60bae5ea9d9de9b2d24bbf
Date: 2010-03-18 13:47:32
User: drh
Comment:Some minor performance improvements on timeline.
Tags And Properties
Changes

Changes to src/attach.c

135 ** 135 ** 136 ** List attachments. 136 ** List attachments. 137 */ 137 */ 138 void attachview_page(void){ 138 void attachview_page(void){ 139 const char *zPage = P("page"); 139 const char *zPage = P("page"); 140 const char *zTkt = P("tkt"); 140 const char *zTkt = P("tkt"); 141 const char *zFile = P("file"); 141 const char *zFile = P("file"); 142 const char *zTarget; | 142 const char *zTarget = 0; 143 int attachid = atoi(PD("attachid","0")); 143 int attachid = atoi(PD("attachid","0")); 144 char *zUUID; 144 char *zUUID; 145 145 146 if( zPage && zTkt ) zTkt = 0; 146 if( zPage && zTkt ) zTkt = 0; 147 if( zFile==0 ) fossil_redirect_home(); 147 if( zFile==0 ) fossil_redirect_home(); 148 login_check_credentials(); 148 login_check_credentials(); 149 if( zPage ){ 149 if( zPage ){

Changes to src/timeline.c

198 wikiFlags = WIKI_INLINE | WIKI_NOBLOCK; 198 wikiFlags = WIKI_INLINE | WIKI_NOBLOCK; 199 } 199 } 200 if( tmFlags & TIMELINE_GRAPH ){ 200 if( tmFlags & TIMELINE_GRAPH ){ 201 pGraph = graph_init(); 201 pGraph = graph_init(); 202 @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div> 202 @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div> 203 } 203 } 204 204 205 db_multi_exec( < 206 "CREATE TEMP TABLE IF NOT EXISTS seen(rid INTEGER PRIMARY KEY);" < 207 "DELETE FROM seen;" < 208 ); < 209 @ <table cellspacing=0 border=0 cellpadding=0> 205 @ <table cellspacing=0 border=0 cellpadding=0> 210 blob_zero(&comment); 206 blob_zero(&comment); 211 while( db_step(pQuery)==SQLITE_ROW ){ 207 while( db_step(pQuery)==SQLITE_ROW ){ 212 int rid = db_column_int(pQuery, 0); 208 int rid = db_column_int(pQuery, 0); 213 const char *zUuid = db_column_text(pQuery, 1); 209 const char *zUuid = db_column_text(pQuery, 1); 214 int nPChild = db_column_int(pQuery, 5); 210 int nPChild = db_column_int(pQuery, 5); 215 int nParent = db_column_int(pQuery, 6); 211 int nParent = db_column_int(pQuery, 6); ................................................................................................................................................................................ 239 @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr> 235 @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr> 240 suppressCnt = 0; 236 suppressCnt = 0; 241 } 237 } 242 if( strcmp(zType,"div")==0 ){ 238 if( strcmp(zType,"div")==0 ){ 243 @ <tr><td colspan=3><hr></td></tr> 239 @ <tr><td colspan=3><hr></td></tr> 244 continue; 240 continue; 245 } 241 } 246 db_multi_exec("INSERT OR IGNORE INTO seen VALUES(%d)", rid); < 247 if( memcmp(zDate, zPrevDate, 10) ){ 242 if( memcmp(zDate, zPrevDate, 10) ){ 248 sprintf(zPrevDate, "%.10s", zDate); 243 sprintf(zPrevDate, "%.10s", zDate); 249 @ <tr><td> 244 @ <tr><td> 250 @ <div class="divider"><nobr>%s(zPrevDate)</nobr></div> 245 @ <div class="divider"><nobr>%s(zPrevDate)</nobr></div> 251 @ </td></tr> 246 @ </td></tr> 252 } 247 } 253 memcpy(zTime, &zDate[11], 5); 248 memcpy(zTime, &zDate[11], 5);

Changes to src/wikiformat.c

367 struct sStack { 367 struct sStack { 368 short iCode; /* Markup code */ 368 short iCode; /* Markup code */ 369 short allowWiki; /* ALLOW_WIKI if wiki allowed before tag */ 369 short allowWiki; /* ALLOW_WIKI if wiki allowed before tag */ 370 const char *zId; /* ID attribute or NULL */ 370 const char *zId; /* ID attribute or NULL */ 371 } *aStack; 371 } *aStack; 372 }; 372 }; 373 373 > 374 /* > 375 ** Return TRUE if HTML should be used as the sole markup language for wiki. > 376 ** > 377 ** On first invocation, this routine consults the "wiki-use-html" setting. > 378 ** It caches the result for subsequent invocations, under the assumption > 379 ** that the setting will not change. > 380 */ > 381 static int wikiUsesHtml(void){ > 382 static int r = -1; > 383 if( r<0 ) r = db_get_boolean("wiki-use-html", 0); > 384 return r; > 385 } > 386 374 387 375 /* 388 /* 376 ** z points to a "<" character. Check to see if this is the start of 389 ** z points to a "<" character. Check to see if this is the start of 377 ** a valid markup. If it is, return the total number of characters in 390 ** a valid markup. If it is, return the total number of characters in 378 ** the markup including the initial "<" and the terminating ">". If 391 ** the markup including the initial "<" and the terminating ">". If 379 ** it is not well-formed markup, return 0. 392 ** it is not well-formed markup, return 0. 380 */ 393 */ ................................................................................................................................................................................ 1388 renderer.state |= INLINE_MARKUP_ONLY; 1401 renderer.state |= INLINE_MARKUP_ONLY; 1389 } 1402 } 1390 if( flags & WIKI_INLINE ){ 1403 if( flags & WIKI_INLINE ){ 1391 renderer.wantAutoParagraph = 0; 1404 renderer.wantAutoParagraph = 0; 1392 }else{ 1405 }else{ 1393 renderer.wantAutoParagraph = 1; 1406 renderer.wantAutoParagraph = 1; 1394 } 1407 } 1395 if( db_get_int("wiki-use-html", 0) ){ | 1408 if( wikiUsesHtml() ){ 1396 renderer.state |= WIKI_USE_HTML; 1409 renderer.state |= WIKI_USE_HTML; 1397 } 1410 } 1398 if( pOut ){ 1411 if( pOut ){ 1399 renderer.pOut = pOut; 1412 renderer.pOut = pOut; 1400 }else{ 1413 }else{ 1401 renderer.pOut = cgi_output_blob(); 1414 renderer.pOut = cgi_output_blob(); 1402 } 1415 } ................................................................................................................................................................................ 1475 int wikiUseHtml = 0; 1488 int wikiUseHtml = 0; 1476 1489 1477 memset(&renderer, 0, sizeof(renderer)); 1490 memset(&renderer, 0, sizeof(renderer)); 1478 renderer.state = ALLOW_WIKI|AT_NEWLINE|AT_PARAGRAPH; 1491 renderer.state = ALLOW_WIKI|AT_NEWLINE|AT_PARAGRAPH; 1479 if( flags & WIKI_NOBLOCK ){ 1492 if( flags & WIKI_NOBLOCK ){ 1480 renderer.state |= INLINE_MARKUP_ONLY; 1493 renderer.state |= INLINE_MARKUP_ONLY; 1481 } 1494 } 1482 if( db_get_int("wiki-use-html", 0) ){ | 1495 if( wikiUsesHtml() ){ 1483 renderer.state |= WIKI_USE_HTML; 1496 renderer.state |= WIKI_USE_HTML; 1484 wikiUseHtml = 1; 1497 wikiUseHtml = 1; 1485 } 1498 } 1486 inlineOnly = (renderer.state & INLINE_MARKUP_ONLY)!=0; 1499 inlineOnly = (renderer.state & INLINE_MARKUP_ONLY)!=0; 1487 if( replaceFlag ){ 1500 if( replaceFlag ){ 1488 db_multi_exec("DELETE FROM backlink WHERE srctype=%d AND srcid=%d", 1501 db_multi_exec("DELETE FROM backlink WHERE srctype=%d AND srcid=%d", 1489 srctype, srcid); 1502 srctype, srcid);