Thread (1 message) 1 message, 1 author, 2024-10-11

Re: [PATCH v6 4/6] transaction: add TRANSACTION_CREATE_EXISTS error

From: Junio C Hamano <hidden>
Date: 2024-10-11 16:34:07

karthik nayak [off-list ref] writes:
quoted
+			} else {
+				int checkret;
+				checkret = check_old_oid(update, &lock->old_oid, err);
+				if  (checkret) {
+					ret = checkret;
+					goto out;
+				}
Can't we simply do:

  ret = check_old_oid(update, &lock->old_oid, err);
  if (ret) {
     goto out
  }

if ret is '0', it shouldn't matter no?
That's nice.  Yes, as long as "ret" has no useful information when
we enter this "else" block, reusing it like you did is just fine.

This is one of these moments I tell myself "oh, why didn't *I* think
of that" ;-).

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help