git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yann Dirson <ydirson@free.fr>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/4] Start to replace locate_rename_dst() with a generic function.
Date: Thu, 4 Nov 2010 22:22:04 +0100	[thread overview]
Message-ID: <20101104212204.GC8911@home.lan> (raw)
In-Reply-To: <20101104204555.GA18187@burratino>

On Thu, Nov 04, 2010 at 03:45:55PM -0500, Jonathan Nieder wrote:
>  static struct diff_rename_dst *locate_rename_dst(struct diff_filespec *two,
> 						  insert_ok)
>  {
> 	return locate_element(&rename_dst_nr, &rename_dst_alloc, elem, insert_ok);
>  }

The idea was to deprecate locate_rename_dst() itself and only use
locate_element()...

> takes more advantage of the compiler's typechecking and looks easy
> enough to read.

... but typechecking was something that was worrying me here.  Looks
like a good idea, after all.


> Since this is local to diffcore-rename, I don't mind the locate_element()
> name, but if this is to be used more widely I think it would need to be
> named more precisely.  (find_or_insert_in_array()?)

Yes - that's just a prototype.

> I guess these parentheses came from search+replace?  It's more
> readable without them.

Right, many of them are superfluous.

  reply	other threads:[~2010-11-04 21:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04 20:33 [RFC PATCH] generalizing sorted-array handling Yann Dirson
2010-11-04 20:33 ` [PATCH 1/4] Start to replace locate_rename_dst() with a generic function Yann Dirson
2010-11-04 20:45   ` Jonathan Nieder
2010-11-04 21:22     ` Yann Dirson [this message]
2010-11-04 20:33 ` [PATCH 2/4] Abstract _locate_element() some more with elem_size parameter Yann Dirson
2010-11-04 20:33 ` [PATCH 3/4] Introduce "abstract class" to make _locate_element() more independant of diff_rename_dst Yann Dirson
2010-11-04 20:56   ` Jonathan Nieder
2010-11-04 20:33 ` [PATCH 4/4] Remove remaining rename_dst references in _locate_element() and pass a pointer to it Yann Dirson

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=20101104212204.GC8911@home.lan \
    --to=ydirson@free.fr \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@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).