Fossil SCM
Remove an unnecessary level of function nesting.
Commit
12989181a635b3bfe8b1105ce9fb261b9d213cd8
Parent
5ea9cf40026fe2a…
2 files changed
-10
+7
-2
-10
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -74,20 +74,10 @@ | ||
| 74 | 74 | } |
| 75 | 75 | load_vfile_from_rid(vid); |
| 76 | 76 | return vid; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | -/* | |
| 80 | -** Load a vfile from a record ID. | |
| 81 | -*/ | |
| 82 | -void load_vfile_from_rid(int vid){ | |
| 83 | - if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ | |
| 84 | - return; | |
| 85 | - } | |
| 86 | - vfile_build(vid); | |
| 87 | -} | |
| 88 | - | |
| 89 | 79 | /* |
| 90 | 80 | ** Set or clear the vfile.isexe flag for a file. |
| 91 | 81 | */ |
| 92 | 82 | static void set_or_clear_isexe(const char *zFilename, int vid, int onoff){ |
| 93 | 83 | static Stmt s; |
| 94 | 84 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -74,20 +74,10 @@ | |
| 74 | } |
| 75 | load_vfile_from_rid(vid); |
| 76 | return vid; |
| 77 | } |
| 78 | |
| 79 | /* |
| 80 | ** Load a vfile from a record ID. |
| 81 | */ |
| 82 | void load_vfile_from_rid(int vid){ |
| 83 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 84 | return; |
| 85 | } |
| 86 | vfile_build(vid); |
| 87 | } |
| 88 | |
| 89 | /* |
| 90 | ** Set or clear the vfile.isexe flag for a file. |
| 91 | */ |
| 92 | static void set_or_clear_isexe(const char *zFilename, int vid, int onoff){ |
| 93 | static Stmt s; |
| 94 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -74,20 +74,10 @@ | |
| 74 | } |
| 75 | load_vfile_from_rid(vid); |
| 76 | return vid; |
| 77 | } |
| 78 | |
| 79 | /* |
| 80 | ** Set or clear the vfile.isexe flag for a file. |
| 81 | */ |
| 82 | static void set_or_clear_isexe(const char *zFilename, int vid, int onoff){ |
| 83 | static Stmt s; |
| 84 |
+7
-2
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -70,19 +70,24 @@ | ||
| 70 | 70 | if( rid==0 && phantomize ){ |
| 71 | 71 | rid = content_new(zUuid, phantomize-1); |
| 72 | 72 | } |
| 73 | 73 | return rid; |
| 74 | 74 | } |
| 75 | + | |
| 75 | 76 | |
| 76 | 77 | /* |
| 77 | -** Build a catalog of all files in a checkin. | |
| 78 | +** Load a vfile from a record ID. | |
| 78 | 79 | */ |
| 79 | -void vfile_build(int vid){ | |
| 80 | +void load_vfile_from_rid(int vid){ | |
| 80 | 81 | int rid, size; |
| 81 | 82 | Stmt ins, ridq; |
| 82 | 83 | Manifest *p; |
| 83 | 84 | ManifestFile *pFile; |
| 85 | + | |
| 86 | + if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ | |
| 87 | + return; | |
| 88 | + } | |
| 84 | 89 | |
| 85 | 90 | db_begin_transaction(); |
| 86 | 91 | p = manifest_get(vid, CFTYPE_MANIFEST); |
| 87 | 92 | if( p==0 ) return; |
| 88 | 93 | db_multi_exec("DELETE FROM vfile WHERE vid=%d", vid); |
| 89 | 94 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -70,19 +70,24 @@ | |
| 70 | if( rid==0 && phantomize ){ |
| 71 | rid = content_new(zUuid, phantomize-1); |
| 72 | } |
| 73 | return rid; |
| 74 | } |
| 75 | |
| 76 | /* |
| 77 | ** Build a catalog of all files in a checkin. |
| 78 | */ |
| 79 | void vfile_build(int vid){ |
| 80 | int rid, size; |
| 81 | Stmt ins, ridq; |
| 82 | Manifest *p; |
| 83 | ManifestFile *pFile; |
| 84 | |
| 85 | db_begin_transaction(); |
| 86 | p = manifest_get(vid, CFTYPE_MANIFEST); |
| 87 | if( p==0 ) return; |
| 88 | db_multi_exec("DELETE FROM vfile WHERE vid=%d", vid); |
| 89 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -70,19 +70,24 @@ | |
| 70 | if( rid==0 && phantomize ){ |
| 71 | rid = content_new(zUuid, phantomize-1); |
| 72 | } |
| 73 | return rid; |
| 74 | } |
| 75 | |
| 76 | |
| 77 | /* |
| 78 | ** Load a vfile from a record ID. |
| 79 | */ |
| 80 | void load_vfile_from_rid(int vid){ |
| 81 | int rid, size; |
| 82 | Stmt ins, ridq; |
| 83 | Manifest *p; |
| 84 | ManifestFile *pFile; |
| 85 | |
| 86 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 87 | return; |
| 88 | } |
| 89 | |
| 90 | db_begin_transaction(); |
| 91 | p = manifest_get(vid, CFTYPE_MANIFEST); |
| 92 | if( p==0 ) return; |
| 93 | db_multi_exec("DELETE FROM vfile WHERE vid=%d", vid); |
| 94 |