Remove redundant function nextPingExt() (#613)

Functionally identical to the older, documented `getNextPingExt()`.

Fixes #610.

Signed-off-by: Paul Arthur <paul.arthur@flowerysong.com>
This commit is contained in:
flowerysong 2024-06-09 00:55:58 -04:00 committed by GitHub
parent aad6769a80
commit d28ae52004
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2579,10 +2579,6 @@ void *preparePingExt(clusterMsgPingExt *ext, uint16_t type, uint32_t length) {
return &ext->ext[0];
}
clusterMsgPingExt *nextPingExt(clusterMsgPingExt *ext) {
return (clusterMsgPingExt *)((char *)ext + ntohl(ext->length));
}
/* 1. If a NULL hdr is provided, compute the extension size;
* 2. If a non-NULL hdr is provided, write the hostname ping
* extension at the start of the cursor. This function
@ -2607,7 +2603,7 @@ uint32_t writePingExt(clusterMsg *hdr, int gossipcount) {
memcpy(ext->hostname, myself->hostname, sdslen(myself->hostname));
/* Move the write cursor */
cursor = nextPingExt(cursor);
cursor = getNextPingExt(cursor);
}
totlen += getHostnamePingExtSize();
@ -2622,7 +2618,7 @@ uint32_t writePingExt(clusterMsg *hdr, int gossipcount) {
memcpy(ext->human_nodename, myself->human_nodename, sdslen(myself->human_nodename));
/* Move the write cursor */
cursor = nextPingExt(cursor);
cursor = getNextPingExt(cursor);
}
totlen += getHumanNodenamePingExtSize();
@ -2644,7 +2640,7 @@ uint32_t writePingExt(clusterMsg *hdr, int gossipcount) {
ext->ttl = htonu64(ttl);
/* Move the write cursor */
cursor = nextPingExt(cursor);
cursor = getNextPingExt(cursor);
}
totlen += getForgottenNodeExtSize();
extensions++;
@ -2658,7 +2654,7 @@ uint32_t writePingExt(clusterMsg *hdr, int gossipcount) {
memcpy(ext->shard_id, myself->shard_id, CLUSTER_NAMELEN);
/* Move the write cursor */
cursor = nextPingExt(cursor);
cursor = getNextPingExt(cursor);
}
totlen += getShardIdPingExtSize();
extensions++;