vcs-svn: simplify cleanup in apply_one_window
commite7e9bd259adac9b4e345e36b9951c9adaddc8227
authorDavid Barr <davidbarr@google.com>
Thu, 31 May 2012 14:41:26 +0000 (1 00:41 +1000)
committerJonathan Nieder <jrnieder@gmail.com>
Fri, 6 Jul 2012 04:26:52 +0000 (5 23:26 -0500)
tree4950cecb83a39f75e95117cdcdb516f4300e5943
parente654f7e8af72a34a3a93ca8786d972eff205e4ab
vcs-svn: simplify cleanup in apply_one_window

Currently the cleanup code looks like this:

free resources
return 0;
 error_out:
free resources
return -1;

Avoid duplicating the "free resources" part by keeping the return
value in a variable and sharing code between the success and
exceptional case:

ret = 0;
 out:
free resources
return ret;

Noticed in the svn-dump-fast-export project, where using the error()
macro in void context produces a warning.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
svndiff.c