[Spice-devel] [PATCH spice-common 2/3] ring: Remove short living temporary variable
Frediano Ziglio
fziglio at redhat.com
Tue Nov 7 10:58:34 UTC 2017
Just a style change, the variable does not help readability.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
common/ring.h | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/common/ring.h b/common/ring.h
index 036c098..1ed3576 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -82,28 +82,22 @@ static inline void ring_remove(RingItem *item)
static inline RingItem *ring_get_head(Ring *ring)
{
- RingItem *ret;
-
spice_assert(ring->next != NULL && ring->prev != NULL);
if (ring_is_empty(ring)) {
return NULL;
}
- ret = ring->next;
- return ret;
+ return ring->next;
}
static inline RingItem *ring_get_tail(Ring *ring)
{
- RingItem *ret;
-
spice_assert(ring->next != NULL && ring->prev != NULL);
if (ring_is_empty(ring)) {
return NULL;
}
- ret = ring->prev;
- return ret;
+ return ring->prev;
}
static inline RingItem *ring_next(Ring *ring, RingItem *pos)
--
2.13.6
More information about the Spice-devel
mailing list