[PATCH spice-server 05/30] Use len parameter directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No reason to copy into another variable.
---
 server/websocket.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/server/websocket.c b/server/websocket.c
index 0f433f0..34a3448 100644
--- a/server/websocket.c
+++ b/server/websocket.c
@@ -268,7 +268,6 @@ int websocket_read(void *opaque, guchar *buf, int size, websocket_frame_t *frame
 
 static int fill_header(guint8 *header, guint64 len)
 {
-    guint64 shiftlen;
     int used = 0;
     int i;
 
@@ -277,12 +276,11 @@ static int fill_header(guint8 *header, guint64 len)
 
     header[1] = 0;
     used++;
-    shiftlen = len;
     if (len > 65535) {
         header[1] |= LENGTH_64BIT;
         for (i = 9; i >= 2; i--) {
-            header[i] = shiftlen & 0xFF;
-            shiftlen = shiftlen >> 8;
+            header[i] = len & 0xFF;
+            len >>= 8;
         }
         used += 8;
     }
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]