From: Jeff King <peff@peff.net>
To: Thiago Farina <tfransosi@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/4] basic priority queue implementation
Date: Fri, 20 May 2011 03:38:21 -0400 [thread overview]
Message-ID: <20110520073821.GA3663@sigill.intra.peff.net> (raw)
In-Reply-To: <BANLkTikLSwWanxUksf3Ezx7uhaTR4mMiWw@mail.gmail.com>
On Thu, May 19, 2011 at 09:47:38PM -0300, Thiago Farina wrote:
> > +void queue_insert(struct queue *pq, void *item);
> I'd rename this to queue_append as we add |item| to the end of the
> array (like you did for sha1_array_append), opposed of inserting it at
> some position/index.
It's definitely not an append. The data structure is a priority queue,
so the element is inserted within the heap at the proper position
according to the comparison function (notice that we stick at the end,
but then heapify_up).
Speaking of naming, though, the real problem is that this data structure
should be called "pqueue" or something similar to indicate that it is
not a simple FIFO. Unfortunately, the short-and-sweet "pqueue" is taken
by openssl, which pollutes all over the global namespace.
-Peff
PS If you don't mind, please try to trim your quoted text a bit. Finding
your 3-line paragraph amid 200 lines of quoted text was a little
challenging. :)
next prev parent reply other threads:[~2011-05-20 7:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-19 20:48 [PATCH] fetch: avoid repeated commits in mark_complete Jeff King
2011-05-19 21:23 ` [RFC/PATCH 0/4] commit lists as priority queues Jeff King
2011-05-19 21:24 ` [PATCH 1/4] Makefile: sort TEST_PROGRAMS list Jeff King
2011-05-19 21:24 ` [PATCH 2/4] basic priority queue implementation Jeff King
2011-05-20 0:47 ` Thiago Farina
2011-05-20 7:38 ` Jeff King [this message]
2011-05-20 13:13 ` Thiago Farina
2011-05-20 13:23 ` Jeff King
2011-05-19 21:25 ` [PATCH 3/4] commit: add infrastructure for priority queues of commits Jeff King
2011-05-19 21:26 ` [PATCH 4/4] fetch-pack: use priority queue for mark_complete Jeff King
2011-05-20 22:03 ` [RFC/PATCH 0/4] commit lists as priority queues Junio C Hamano
2011-05-20 1:42 ` [PATCH] fetch: avoid repeated commits in mark_complete Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110520073821.GA3663@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=tfransosi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).