1212#include "object-name.h"
1313#include "pager.h"
1414#include "parse-options.h"
15- #include "prio-queue.h"
1615#include "hash-lookup.h"
1716#include "commit-slab.h"
1817#include "commit-graph.h"
@@ -178,7 +177,7 @@ static void name_rev(struct commit *start_commit,
178177 const char * tip_name , timestamp_t taggerdate ,
179178 int from_tag , int deref , struct mem_pool * string_pool )
180179{
181- struct prio_queue queue ;
180+ struct commit_stack stack = COMMIT_STACK_INIT ;
182181 struct commit * commit ;
183182 struct commit_stack parents_to_queue = COMMIT_STACK_INIT ;
184183 struct rev_name * start_name ;
@@ -197,10 +196,9 @@ static void name_rev(struct commit *start_commit,
197196 else
198197 start_name -> tip_name = mem_pool_strdup (string_pool , tip_name );
199198
200- memset (& queue , 0 , sizeof (queue )); /* Use the prio_queue as LIFO */
201- prio_queue_put (& queue , start_commit );
199+ commit_stack_push (& stack , start_commit );
202200
203- while ((commit = prio_queue_get ( & queue ))) {
201+ while ((commit = commit_stack_pop ( & stack ))) {
204202 struct rev_name * name = get_commit_rev_name (commit );
205203 struct commit_list * parents ;
206204 int parent_number = 1 ;
@@ -241,13 +239,13 @@ static void name_rev(struct commit *start_commit,
241239 }
242240 }
243241
244- /* The first parent must come out first from the prio_queue */
242+ /* The first parent must come out first from the stack */
245243 while (parents_to_queue .nr )
246- prio_queue_put ( & queue ,
247- commit_stack_pop (& parents_to_queue ));
244+ commit_stack_push ( & stack ,
245+ commit_stack_pop (& parents_to_queue ));
248246 }
249247
250- clear_prio_queue ( & queue );
248+ commit_stack_clear ( & stack );
251249 commit_stack_clear (& parents_to_queue );
252250}
253251
0 commit comments