Fossil SCM

Minor optimization in stash_create to bypass an unneeded blob_compare() when (isLink!=isNewLink).

stephan 2012-07-03 21:10 trunk
Commit 75461b993e85b8000a4198bca39270835fc679bd
1 file changed +1 -1
+1 -1
--- src/stash.c
+++ src/stash.c
@@ -216,11 +216,11 @@
216216
}else{
217217
blob_read_from_file(&disk, zOPath);
218218
}
219219
content_get(rid, &a);
220220
blob_delta_apply(&a, &delta, &b);
221
- if( blob_compare(&disk, &a)==0 && isLink == isNewLink ){
221
+ if( isLink == isNewLink && blob_compare(&disk, &a)==0 ){
222222
if( isLink || isNewLink ){
223223
file_delete(zNPath);
224224
}
225225
if( isLink ){
226226
symlink_create(blob_str(&b), zNPath);
227227
--- src/stash.c
+++ src/stash.c
@@ -216,11 +216,11 @@
216 }else{
217 blob_read_from_file(&disk, zOPath);
218 }
219 content_get(rid, &a);
220 blob_delta_apply(&a, &delta, &b);
221 if( blob_compare(&disk, &a)==0 && isLink == isNewLink ){
222 if( isLink || isNewLink ){
223 file_delete(zNPath);
224 }
225 if( isLink ){
226 symlink_create(blob_str(&b), zNPath);
227
--- src/stash.c
+++ src/stash.c
@@ -216,11 +216,11 @@
216 }else{
217 blob_read_from_file(&disk, zOPath);
218 }
219 content_get(rid, &a);
220 blob_delta_apply(&a, &delta, &b);
221 if( isLink == isNewLink && blob_compare(&disk, &a)==0 ){
222 if( isLink || isNewLink ){
223 file_delete(zNPath);
224 }
225 if( isLink ){
226 symlink_create(blob_str(&b), zNPath);
227

Keyboard Shortcuts

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