From: Ralf Thielow <ralf.thielow@googlemail.com>
To: git@vger.kernel.org
Cc: Ralf Thielow <ralf.thielow@googlemail.com>
Subject: [PATCH 2/2] simplify digit_in_number
Date: Sun, 25 Jul 2010 19:36:21 +0200 [thread overview]
Message-ID: <1280079381-4548-2-git-send-email-ralf.thielow@googlemail.com> (raw)
In-Reply-To: <1280079381-4548-1-git-send-email-ralf.thielow@googlemail.com>
---
log-tree.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/log-tree.c b/log-tree.c
index 95a00a4..c2af716 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -254,10 +254,10 @@ static void append_signoff(struct strbuf *sb, const char *signoff)
static unsigned int digits_in_number(unsigned int number)
{
- int digits = 0;
+ int digits = 1;
while (number /= 10)
digits++;
- return digits++;
+ return digits;
}
void get_patch_filename(struct commit *commit, int nr, const char *suffix,
--
1.7.0.4
next prev parent reply other threads:[~2010-07-25 17:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-25 17:36 [PATCH 1/2] log-tree: simplify digit_in_number Ralf Thielow
2010-07-25 17:36 ` Ralf Thielow [this message]
2010-07-25 17:46 ` Jonathan Nieder
-- strict thread matches above, loose matches on Subject: below --
2010-07-25 17:43 Ralf Thielow
2010-07-25 17:43 ` [PATCH 2/2] " Ralf Thielow
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=1280079381-4548-2-git-send-email-ralf.thielow@googlemail.com \
--to=ralf.thielow@googlemail.com \
--cc=git@vger.kernel.org \
/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).