Fossil SCM
Minor optimization in stash_create to bypass an unneeded blob_compare() when (isLink!=isNewLink).
Commit
75461b993e85b8000a4198bca39270835fc679bd
Parent
6ad70288d9f49a5…
1 file changed
+1
-1
+1
-1
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -216,11 +216,11 @@ | ||
| 216 | 216 | }else{ |
| 217 | 217 | blob_read_from_file(&disk, zOPath); |
| 218 | 218 | } |
| 219 | 219 | content_get(rid, &a); |
| 220 | 220 | blob_delta_apply(&a, &delta, &b); |
| 221 | - if( blob_compare(&disk, &a)==0 && isLink == isNewLink ){ | |
| 221 | + if( isLink == isNewLink && blob_compare(&disk, &a)==0 ){ | |
| 222 | 222 | if( isLink || isNewLink ){ |
| 223 | 223 | file_delete(zNPath); |
| 224 | 224 | } |
| 225 | 225 | if( isLink ){ |
| 226 | 226 | symlink_create(blob_str(&b), zNPath); |
| 227 | 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( 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 |