gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: remove unnecessary networkr


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: remove unnecessary networkrecord padding
Date: Sun, 24 Jun 2018 18:05:58 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 1981ffec4 remove unnecessary networkrecord padding
1981ffec4 is described below

commit 1981ffec4ad18287efe8ab693390e1d498de05bf
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Sun Jun 24 18:05:56 2018 +0200

    remove unnecessary networkrecord padding
---
 src/gnsrecord/gnsrecord_serialization.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/gnsrecord/gnsrecord_serialization.c 
b/src/gnsrecord/gnsrecord_serialization.c
index 82b09c24e..a1cfbe984 100644
--- a/src/gnsrecord/gnsrecord_serialization.c
+++ b/src/gnsrecord/gnsrecord_serialization.c
@@ -89,7 +89,6 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
                                   const struct GNUNET_GNSRECORD_Data *rd)
 {
   size_t ret;
-  size_t no_padding;
 
   ret = sizeof (struct NetworkRecord) * rd_count;
   for (unsigned int i=0;i<rd_count;i++)
@@ -129,7 +128,6 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
    * power of 2 for padding
    * https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
    */
-  no_padding = ret;
   ret--;
   ret |= ret >> 1;
   ret |= ret >> 2;
@@ -137,9 +135,6 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
   ret |= ret >> 8;
   ret |= ret >> 16;
   ret++;
-  //If padding record does not fit, pad again.
-  if ((ret - no_padding) < sizeof (struct NetworkRecord))
-    ret = ret << 1;
   return (ssize_t) ret;
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]