From 39cb30a4beeb5f5ae3a8a6070d65300c29ce6d88 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Fri, 7 Sep 2007 18:49:47 +0200 Subject: [PATCH] simplify Iterator::GetDistanceFrom method --- src/common/buffer.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index e30dc7b39..8bef1500e 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -280,9 +280,7 @@ uint32_t Buffer::Iterator::GetDistanceFrom (Iterator const &o) const { NS_ASSERT (m_data == o.m_data); - int32_t start = m_current; - int32_t end = o.m_current; - int32_t diff = end - start; + int32_t diff = m_current - o.m_current; if (diff < 0) { return -diff;