Messages in this thread | | | Date | Thu, 23 May 2013 11:17:40 +0200 | From | Arnaldo Carvalho de Melo <> | Subject | Re: [PATCH 01/14] perf diff: Use internal rb tree for hists__precompute |
| |
Em Thu, Dec 13, 2012 at 02:08:59PM +0100, Jiri Olsa escreveu:
> diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
> while (next != NULL) { > - struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node); > - struct hist_entry *pair = hist_entry__next_pair(he); > + struct hist_entry *he, *pair; > > - next = rb_next(&he->rb_node); > + he = rb_entry(next, struct hist_entry, rb_node_in); > + pair = hist_entry__next_pair(he); > + > + next = rb_next(&he->rb_node_in);
To ease review please try to make the patch as minimal as possible, i.e. the above could be done as:
- struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node); + struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node_in); struct hist_entry *pair = hist_entry__next_pair(he);
- next = rb_next(&he->rb_node); + next = rb_next(&he->rb_node_in);
See how we can more quickly see what happened? I.e. just replacing 'rb_node' with 'rb_node_in' :-)
- Arnaldo
| |