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
- branch=trunk inherited from [a28c83647d] branch timeline
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Changes to src/attach.c
@@ -137,11 +137,11 @@
*/
void attachview_page(void){
const char *zPage = P("page");
const char *zTkt = P("tkt");
const char *zFile = P("file");
- const char *zTarget;
+ const char *zTarget = 0;
int attachid = atoi(PD("attachid","0"));
char *zUUID;
if( zPage && zTkt ) zTkt = 0;
if( zFile==0 ) fossil_redirect_home();
Changes to src/timeline.c
@@ -200,14 +200,10 @@
if( tmFlags & TIMELINE_GRAPH ){
pGraph = graph_init();
@ <div id="canvas" style="position:relative;width:1px;height:1px;"></div>
}
- db_multi_exec(
- "CREATE TEMP TABLE IF NOT EXISTS seen(rid INTEGER PRIMARY KEY);"
- "DELETE FROM seen;"
- );
@ <table cellspacing=0 border=0 cellpadding=0>
blob_zero(&comment);
while( db_step(pQuery)==SQLITE_ROW ){
int rid = db_column_int(pQuery, 0);
const char *zUuid = db_column_text(pQuery, 1);
@@ -241,11 +237,10 @@
}
if( strcmp(zType,"div")==0 ){
@ <tr><td colspan=3><hr></td></tr>
continue;
}
- db_multi_exec("INSERT OR IGNORE INTO seen VALUES(%d)", rid);
if( memcmp(zDate, zPrevDate, 10) ){
sprintf(zPrevDate, "%.10s", zDate);
@ <tr><td>
@ <div class="divider"><nobr>%s(zPrevDate)</nobr></div>
@ </td></tr>
Changes to src/wikiformat.c
@@ -369,10 +369,23 @@
short allowWiki; /* ALLOW_WIKI if wiki allowed before tag */
const char *zId; /* ID attribute or NULL */
} *aStack;
};
+/*
+** Return TRUE if HTML should be used as the sole markup language for wiki.
+**
+** On first invocation, this routine consults the "wiki-use-html" setting.
+** It caches the result for subsequent invocations, under the assumption
+** that the setting will not change.
+*/
+static int wikiUsesHtml(void){
+ static int r = -1;
+ if( r<0 ) r = db_get_boolean("wiki-use-html", 0);
+ return r;
+}
+
/*
** z points to a "<" character. Check to see if this is the start of
** a valid markup. If it is, return the total number of characters in
** the markup including the initial "<" and the terminating ">". If
@@ -1390,11 +1403,11 @@
if( flags & WIKI_INLINE ){
renderer.wantAutoParagraph = 0;
}else{
renderer.wantAutoParagraph = 1;
}
- if( db_get_int("wiki-use-html", 0) ){
+ if( wikiUsesHtml() ){
renderer.state |= WIKI_USE_HTML;
}
if( pOut ){
renderer.pOut = pOut;
}else{
@@ -1477,11 +1490,11 @@
memset(&renderer, 0, sizeof(renderer));
renderer.state = ALLOW_WIKI|AT_NEWLINE|AT_PARAGRAPH;
if( flags & WIKI_NOBLOCK ){
renderer.state |= INLINE_MARKUP_ONLY;
}
- if( db_get_int("wiki-use-html", 0) ){
+ if( wikiUsesHtml() ){
renderer.state |= WIKI_USE_HTML;
wikiUseHtml = 1;
}
inlineOnly = (renderer.state & INLINE_MARKUP_ONLY)!=0;
if( replaceFlag ){