Use range-based for loop in remote_add_target_side_condition
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 27 Feb 2017 18:54:53 +0000 (13:54 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 27 Feb 2017 18:54:53 +0000 (13:54 -0500)
Using a range based for loop makes this code a bit more clean and
readable.

The comment above is clearly erroneous, so I've updated it.

gdb/ChangeLog:

* remote.c (remote_add_target_side_condition): Use range-based
for loop.  Update comment.

gdb/ChangeLog
gdb/remote.c

index a7be8266ea906c18a88609a60ca1480c703b2091..a872f1bfb98108bf1def015a2563f2e80c83b9b0 100644 (file)
@@ -1,3 +1,8 @@
+2017-02-27  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * remote.c (remote_add_target_side_condition): Use range-based
+       for loop.  Update comment.
+
 2017-02-27  Yao Qi  <yao.qi@linaro.org>
 
        * f-typeprint.c (f_print_type): Check "varstring" is empty first.
index 87fb6e02ea3df3d8fecaf3fecc45790bdbfb6f6f..aedbd08cc43e60393db9a4886a5ddb274b38f603 100644 (file)
@@ -9664,11 +9664,9 @@ remote_add_target_side_condition (struct gdbarch *gdbarch,
   xsnprintf (buf, buf_end - buf, "%s", ";");
   buf++;
 
-  /* Send conditions to the target and free the vector.  */
-  for (int ix = 0; ix < bp_tgt->conditions.size (); ix++)
+  /* Send conditions to the target.  */
+  for (struct agent_expr *aexpr : bp_tgt->conditions)
     {
-      struct agent_expr *aexpr = bp_tgt->conditions[ix];
-
       xsnprintf (buf, buf_end - buf, "X%x,", aexpr->len);
       buf += strlen (buf);
       for (int i = 0; i < aexpr->len; ++i)
This page took 0.031851 seconds and 4 git commands to generate.