Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit 3e7b82d

Browse files
author
Mathieu Borderé
committed
uv_encoding: Remove dead code.
1 parent d54c65d commit 3e7b82d

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

src/uv_encoding.c

-39
Original file line numberDiff line numberDiff line change
@@ -548,42 +548,3 @@ void uvDecodeEntriesBatch(uint8_t *batch,
548548
}
549549
}
550550
}
551-
552-
int uvEncodeSnapshotMeta(const struct raft_configuration *conf,
553-
raft_index conf_index,
554-
struct raft_buffer *buf)
555-
{
556-
size_t conf_len;
557-
void *cursor;
558-
uint64_t *header;
559-
void *conf_buf;
560-
unsigned crc;
561-
562-
conf_len = configurationEncodedSize(conf);
563-
564-
buf->len = sizeof(*header) * 4; /* Format, CRC, configuration index/len */
565-
buf->len += conf_len;
566-
buf->base = raft_malloc(buf->len);
567-
if (buf->base == NULL) {
568-
return RAFT_NOMEM;
569-
}
570-
571-
header = buf->base;
572-
conf_buf = header + 4;
573-
574-
configurationEncodeToBuf(conf, conf_buf);
575-
576-
cursor = header;
577-
bytePut64(&cursor, UV__DISK_FORMAT);
578-
bytePut64(&cursor, 0);
579-
bytePut64(&cursor, conf_index);
580-
bytePut64(&cursor, conf_len);
581-
582-
crc = byteCrc32(&header[2], sizeof(uint64_t) * 2, 0); /* Conf index/len */
583-
crc = byteCrc32(conf_buf, conf_len, crc);
584-
585-
cursor = &header[1];
586-
bytePut64(&cursor, crc);
587-
588-
return 0;
589-
}

src/uv_encoding.h

-4
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,5 @@ void uvEncodeBatchHeader(const struct raft_entry *entries,
5656
unsigned n,
5757
void *buf);
5858

59-
/* Encode the content of a snapshot metadata file. */
60-
int uvEncodeSnapshotMeta(const struct raft_configuration *conf,
61-
raft_index conf_index,
62-
struct raft_buffer *buf);
6359

6460
#endif /* UV_ENCODING_H_ */

0 commit comments

Comments
 (0)