[binutils-gdb] gdb/dwarf: rename low_set variable in dwarf2_ranges_read

Simon Marchi via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ee86490975dfe5294af042cb7f347e0667144e7d

commit ee86490975dfe5294af042cb7f347e0667144e7d
Author: Simon Marchi <[email protected]>
Date:   Thu Mar 12 12:32:03 2026 -0400

    gdb/dwarf: rename low_set variable in dwarf2_ranges_read
    
    Rename low_set to low_high_set, to reflect what it really means.
    
    Also, change some manual min/max so use std::min/std::max, I think it
    makes the intent clearer.
    
    Change-Id: I9ca81be915962e704becabe78c39b95e0abf561b
    Approved-By: Tom de Vries <[email protected]>

Diff:
---
 gdb/dwarf2/read.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index e436e0df857..31c44476d2c 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -8717,7 +8717,7 @@ dwarf2_ranges_read (unsigned offset, unrelocated_addr *low_return,
 		    unrelocated_addr *high_return, struct dwarf2_cu *cu,
 		    addrmap_mutable *map, void *datum, dwarf_tag tag)
 {
-  bool low_set = false;
+  bool low_high_set = false;
   unrelocated_addr low = {};
   unrelocated_addr high = {};
   bool retval = dwarf2_ranges_process (offset, cu, tag,
@@ -8735,29 +8735,26 @@ dwarf2_ranges_read (unsigned offset, unrelocated_addr *low_return,
 	 segment of consecutive addresses.  We should have a
 	 data structure for discontiguous block ranges
 	 instead.  */
-      if (!low_set)
+      if (!low_high_set)
 	{
 	  low = range_beginning;
 	  high = range_end;
-	  low_set = true;
+	  low_high_set = true;
 	}
       else
 	{
-	  if (range_beginning < low)
-	    low = range_beginning;
-
-	  if (range_end > high)
-	    high = range_end;
+	  low = std::min (low, range_beginning);
+	  high = std::max (high, range_end);
 	}
     });
 
   if (!retval)
     return false;
 
-  if (!low_set)
+  if (!low_high_set)
     {
       /* If the first entry is an end-of-list marker, the range
-       describes an empty scope, i.e. no instructions.  */
+	 describes an empty scope, i.e. no instructions.  */
       return false;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.