Hi Dirkhh and others,
I am submitting my first patch(my first one ever). This is very minor and
acute.

I am sending this,as an improvement to the existing code since
goto is not preferred as a reliable keyword in software development process.

I can change the logic regarding goto in all the cpp files in the existing
codebase. I am good at C++, so I am sure that I will not disturb the logic
part.

If I am not sure,I will ensure not to touch that part of code.
This(removing goto) would make the code base more reliable. Let me know
your feedback.

Thanks&Regards
Gopichand.
From d2a6a3fab7f98d36a78d43c1eaf603b6c673891a Mon Sep 17 00:00:00 2001
From: g1g19 <[email protected]>
Date: Sat, 1 Mar 2014 22:57:36 +0530
Subject: [PATCH] Deleted goto statement & maintained the logic 
Signed-off-by: Gopichand Paturi <[email protected]>

---
 divelist.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/divelist.c b/divelist.c
index 9dc4b94..00fb0d5 100644
--- a/divelist.c
+++ b/divelist.c
@@ -158,13 +158,16 @@ void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p)
 			o2 = O2_IN_AIR;
 		if (o2 < mino2)
 			mino2 = o2;
-		if (he > maxhe)
-			goto newmax;
+		if (he > maxhe){		
+			maxhe = he;
+			maxo2 = o2;
+			continue;       
+		}
 		if (he < maxhe)
 			continue;
 		if (o2 <= maxo2)
 			continue;
-newmax:
+
 		maxhe = he;
 		maxo2 = o2;
 	}
-- 
1.7.9.5

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to