Fossil SCM

Speedup of "fossil rebuild" by not calculating the Z checksum unnecessary. Doing a "fossil rebuild" on the Tcl fossil repository, this saves about 1 second (out of 1m22) on my machine. OK, OK, not THAT impressive, but it's a measurable gain with 0 cost.

jan.nijtmans 2013-08-22 18:22 trunk
Commit 960fb04e35a529e32cb7cc1dfe591754e50b8596
1 file changed +8 -7
+8 -7
--- src/manifest.c
+++ src/manifest.c
@@ -378,27 +378,28 @@
378378
blob_reset(pContent);
379379
blob_appendf(pErr, n ? "not terminated with \\n" : "zero-length");
380380
return 0;
381381
}
382382
383
- /* Strip off the PGP signature if there is one. Then verify the
384
- ** Z-card.
383
+ /* Strip off the PGP signature if there is one.
385384
*/
386385
remove_pgp_signature(&z, &n);
387
- if( verify_z_card(z, n)==2 ){
388
- blob_reset(pContent);
389
- blob_appendf(pErr, "incorrect Z-card cksum");
390
- return 0;
391
- }
392386
393387
/* Verify that the first few characters of the artifact look like
394388
** a control artifact.
395389
*/
396390
if( n<10 || z[0]<'A' || z[0]>'Z' || z[1]!=' ' ){
397391
blob_reset(pContent);
398392
blob_appendf(pErr, "line 1 not recognized");
399393
return 0;
394
+ }
395
+ /* Then verify the Z-card.
396
+ */
397
+ if( verify_z_card(z, n)==2 ){
398
+ blob_reset(pContent);
399
+ blob_appendf(pErr, "incorrect Z-card cksum");
400
+ return 0;
400401
}
401402
402403
/* Allocate a Manifest object to hold the parsed control artifact.
403404
*/
404405
p = fossil_malloc( sizeof(*p) );
405406
--- src/manifest.c
+++ src/manifest.c
@@ -378,27 +378,28 @@
378 blob_reset(pContent);
379 blob_appendf(pErr, n ? "not terminated with \\n" : "zero-length");
380 return 0;
381 }
382
383 /* Strip off the PGP signature if there is one. Then verify the
384 ** Z-card.
385 */
386 remove_pgp_signature(&z, &n);
387 if( verify_z_card(z, n)==2 ){
388 blob_reset(pContent);
389 blob_appendf(pErr, "incorrect Z-card cksum");
390 return 0;
391 }
392
393 /* Verify that the first few characters of the artifact look like
394 ** a control artifact.
395 */
396 if( n<10 || z[0]<'A' || z[0]>'Z' || z[1]!=' ' ){
397 blob_reset(pContent);
398 blob_appendf(pErr, "line 1 not recognized");
399 return 0;
 
 
 
 
 
 
 
400 }
401
402 /* Allocate a Manifest object to hold the parsed control artifact.
403 */
404 p = fossil_malloc( sizeof(*p) );
405
--- src/manifest.c
+++ src/manifest.c
@@ -378,27 +378,28 @@
378 blob_reset(pContent);
379 blob_appendf(pErr, n ? "not terminated with \\n" : "zero-length");
380 return 0;
381 }
382
383 /* Strip off the PGP signature if there is one.
 
384 */
385 remove_pgp_signature(&z, &n);
 
 
 
 
 
386
387 /* Verify that the first few characters of the artifact look like
388 ** a control artifact.
389 */
390 if( n<10 || z[0]<'A' || z[0]>'Z' || z[1]!=' ' ){
391 blob_reset(pContent);
392 blob_appendf(pErr, "line 1 not recognized");
393 return 0;
394 }
395 /* Then verify the Z-card.
396 */
397 if( verify_z_card(z, n)==2 ){
398 blob_reset(pContent);
399 blob_appendf(pErr, "incorrect Z-card cksum");
400 return 0;
401 }
402
403 /* Allocate a Manifest object to hold the parsed control artifact.
404 */
405 p = fossil_malloc( sizeof(*p) );
406

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button