From 20f244562878516a687bacb148b5025a7f466b60 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Apr 2026 23:32:16 +0000 Subject: [PATCH] Remove unnecessary xref sorting on every query ##analysis --- libr/anal/xrefs.c | 3 --- test/db/cmd/cmd_af | 64 +++++++++++++++++++++++----------------------- test/db/cmd/cmd_ag | 16 ++++++------ 3 files changed, 40 insertions(+), 43 deletions(-) diff --git a/libr/anal/xrefs.c b/libr/anal/xrefs.c index bbcd0bd679b35..b41e6ccfe469e 100644 --- a/libr/anal/xrefs.c +++ b/libr/anal/xrefs.c @@ -326,7 +326,6 @@ R_API RVecAnalRef *r_anal_refs_get(RAnal *anal, ut64 from) { return NULL; } - RVecAnalRef_sort (anal_refs, compare_ref); // XXX not needed? return anal_refs; } @@ -339,7 +338,6 @@ R_API RVecAnalRef *r_anal_xrefs_get(RAnal *anal, ut64 to) { return NULL; } - RVecAnalRef_sort (anal_refs, compare_ref); // XXX not needed? return anal_refs; } @@ -352,7 +350,6 @@ R_API RVecAnalRef *r_anal_xrefs_get_from(RAnal *anal, ut64 to) { return NULL; } - RVecAnalRef_sort (anal_refs, compare_ref); // XXX not needed? return anal_refs; } diff --git a/test/db/cmd/cmd_af b/test/db/cmd/cmd_af index ee55fefc66ead..d5c6e75d2077f 100644 --- a/test/db/cmd/cmd_af +++ b/test/db/cmd/cmd_af @@ -33,47 +33,47 @@ af axf@0x100001308 EOF EXPECT=< 4 6 [URL="sym.imp.strlen", color="lightgray", label="sym.imp.strlen"] -7 [URL="0x000007cf", color="lightgray", label="0x000007cf"] +7 [URL="0x000007de", color="lightgray", label="0x000007de"] 7 -> 6 -8 [URL="0x000007de", color="lightgray", label="0x000007de"] +8 [URL="0x000007cf", color="lightgray", label="0x000007cf"] 8 -> 6 9 [URL="sym.imp.malloc", color="lightgray", label="sym.imp.malloc"] 10 [URL="0x000007f6", color="lightgray", label="0x000007f6"] @@ -142,11 +142,11 @@ directed 1 ] node [ id 7 - label "0x000007cf" + label "0x000007de" ] node [ id 8 - label "0x000007de" + label "0x000007cf" ] node [ id 9 @@ -205,13 +205,13 @@ directed 1 target 13 ] ] -{"nodes":[{"id":0,"title":"sym.imp.free","offset":1584,"out_nodes":[]},{"id":1,"title":"0x0000083f","offset":2111,"out_nodes":[0]},{"id":2,"title":"sym.imp.strcpy","offset":1600,"out_nodes":[]},{"id":3,"title":"0x00000814","offset":2068,"out_nodes":[2]},{"id":4,"title":"sym.imp.puts","offset":1616,"out_nodes":[]},{"id":5,"title":"0x00000833","offset":2099,"out_nodes":[4]},{"id":6,"title":"sym.imp.strlen","offset":1632,"out_nodes":[]},{"id":7,"title":"0x000007cf","offset":1999,"out_nodes":[6]},{"id":8,"title":"0x000007de","offset":2014,"out_nodes":[6]},{"id":9,"title":"sym.imp.malloc","offset":1648,"out_nodes":[]},{"id":10,"title":"0x000007f6","offset":2038,"out_nodes":[9]},{"id":11,"title":"sym.imp.strcat","offset":1664,"out_nodes":[]},{"id":12,"title":"0x00000827","offset":2087,"out_nodes":[11]},{"id":13,"title":"sym.imp.__cxa_finalize","offset":1680,"out_nodes":[]},{"id":14,"title":"0x0000077e","offset":1918,"out_nodes":[13]}]} +{"nodes":[{"id":0,"title":"sym.imp.free","offset":1584,"out_nodes":[]},{"id":1,"title":"0x0000083f","offset":2111,"out_nodes":[0]},{"id":2,"title":"sym.imp.strcpy","offset":1600,"out_nodes":[]},{"id":3,"title":"0x00000814","offset":2068,"out_nodes":[2]},{"id":4,"title":"sym.imp.puts","offset":1616,"out_nodes":[]},{"id":5,"title":"0x00000833","offset":2099,"out_nodes":[4]},{"id":6,"title":"sym.imp.strlen","offset":1632,"out_nodes":[]},{"id":7,"title":"0x000007de","offset":2014,"out_nodes":[6]},{"id":8,"title":"0x000007cf","offset":1999,"out_nodes":[6]},{"id":9,"title":"sym.imp.malloc","offset":1648,"out_nodes":[]},{"id":10,"title":"0x000007f6","offset":2038,"out_nodes":[9]},{"id":11,"title":"sym.imp.strcat","offset":1664,"out_nodes":[]},{"id":12,"title":"0x00000827","offset":2087,"out_nodes":[11]},{"id":13,"title":"sym.imp.__cxa_finalize","offset":1680,"out_nodes":[]},{"id":14,"title":"0x0000077e","offset":1918,"out_nodes":[13]}]} agraph.color_box=G1swbQ== agraph.delta_x=0x4d agraph.delta_y=0x1 agraph.h=0x10 agraph.is_callgraph=false -agraph.nodes=sym.imp.free,0x0000083f,sym.imp.strcpy,0x00000814,sym.imp.puts,0x00000833,sym.imp.strlen,0x000007cf,0x000007de,sym.imp.malloc,0x000007f6,sym.imp.strcat,0x00000827,sym.imp.__cxa_finalize,0x0000077e +agraph.nodes=sym.imp.free,0x0000083f,sym.imp.strcpy,0x00000814,sym.imp.puts,0x00000833,sym.imp.strlen,0x000007de,0x000007cf,sym.imp.malloc,0x000007f6,sym.imp.strcat,0x00000827,sym.imp.__cxa_finalize,0x0000077e agraph.nodes.0x0000077e.body=base64: agraph.nodes.0x0000077e.h=0x3 agraph.nodes.0x0000077e.neighbours=sym.imp.__cxa_finalize @@ -222,13 +222,13 @@ agraph.nodes.0x000007cf.body=base64: agraph.nodes.0x000007cf.h=0x3 agraph.nodes.0x000007cf.neighbours=sym.imp.strlen agraph.nodes.0x000007cf.w=0x16 -agraph.nodes.0x000007cf.x=0x4e +agraph.nodes.0x000007cf.x=0x68 agraph.nodes.0x000007cf.y=0x4d agraph.nodes.0x000007de.body=base64: agraph.nodes.0x000007de.h=0x3 agraph.nodes.0x000007de.neighbours=sym.imp.strlen agraph.nodes.0x000007de.w=0x16 -agraph.nodes.0x000007de.x=0x68 +agraph.nodes.0x000007de.x=0x4e agraph.nodes.0x000007de.y=0x4d agraph.nodes.0x000007f6.body=base64: agraph.nodes.0x000007f6.h=0x3