shithub: git9

Download patch

ref: f5805c3552dd00a6018f8440c1a4c8aa6755fd03
parent: 4f6509f5c6e075201c450862d32c0d76514b3658
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Oct 16 03:48:46 EDT 2019

Optimize git/walk: check QID first.

--- a/walk.c
+++ b/walk.c
@@ -276,7 +276,10 @@
 		snprint(rmpath, sizeof(rmpath), RDIR"/%s", p);
 		snprint(tpath, sizeof(tpath), TDIR"/%s", p);
 		snprint(bpath, sizeof(bpath), HDIR"/%s", p);
-		if(access(p, AEXIST) != 0 || access(rmpath, AEXIST) == 0){
+		if(sameqid(p, tpath)){
+			if(!quiet && (printflg & Tflg))
+				print("%s%s\n", tstr, p);
+		}else if(access(p, AEXIST) != 0 || access(rmpath, AEXIST) == 0){
 			dirty |= Mflg;
 			if(!quiet && (printflg & Rflg))
 				print("%s%s\n", rstr, p);
@@ -284,7 +287,7 @@
 			dirty |= Aflg;
 			if(!quiet && (printflg & Aflg))
 				print("%s%s\n", astr, p);
-		}else if(!sameqid(p, tpath) && !samedata(p, bpath)){
+		}else if(!samedata(p, bpath)){
 			dirty |= Mflg;
 			if(!quiet && (printflg & Mflg))
 				print("%s%s\n", mstr, p);