[PATCH] isoinfo: remove the useless goto
Code cleanup. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- daemon/isoinfo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/daemon/isoinfo.c b/daemon/isoinfo.c index c0ee1c9..fd777bd 100644 --- a/daemon/isoinfo.c +++ b/daemon/isoinfo.c @@ -255,8 +255,6 @@ isoinfo (const char *path) goto done; ret = parse_isoinfo (lines); - if (ret == NULL) - goto done; done: free (out); -- 1.7.11.2.249.g31c7954
On Mon, Jul 16, 2012 at 04:03:57PM +0800, Wanlong Gao wrote:
Code cleanup.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- daemon/isoinfo.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/daemon/isoinfo.c b/daemon/isoinfo.c index c0ee1c9..fd777bd 100644 --- a/daemon/isoinfo.c +++ b/daemon/isoinfo.c @@ -255,8 +255,6 @@ isoinfo (const char *path) goto done;
ret = parse_isoinfo (lines); - if (ret == NULL) - goto done;
done: free (out);
The goto helps maintenance. In future we might add more lines between the 'goto' and the 'done:' label. In any case, the compiler can easily work out that this is useless and optimize it away. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
On 07/16/2012 04:12 PM, Richard W.M. Jones wrote:
On Mon, Jul 16, 2012 at 04:03:57PM +0800, Wanlong Gao wrote:
Code cleanup.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- daemon/isoinfo.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/daemon/isoinfo.c b/daemon/isoinfo.c index c0ee1c9..fd777bd 100644 --- a/daemon/isoinfo.c +++ b/daemon/isoinfo.c @@ -255,8 +255,6 @@ isoinfo (const char *path) goto done;
ret = parse_isoinfo (lines); - if (ret == NULL) - goto done;
done: free (out);
The goto helps maintenance. In future we might add more lines between the 'goto' and the 'done:' label. In any case, the compiler can easily work out that this is useless and optimize it away.
Got it, thank you. Wanlong Gao
Rich.
participants (2)
-
Richard W.M. Jones -
Wanlong Gao