mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-14 06:06:44 +00:00
Remove useless tests that have constant value because the variables are unsigned.
This commit is contained in:
parent
fde6dc210f
commit
1124e3de34
@ -1135,7 +1135,7 @@ static int pipe_journal(struct rhizome_fetch_slot *slot){
|
||||
uint64_t length = slot->previous->fileLength - slot->manifest->journalTail - slot->write_state.file_offset;
|
||||
|
||||
// of course there might not be any overlap
|
||||
if (start>=0 && start < slot->previous->fileLength && length>0){
|
||||
if (start < slot->previous->fileLength && length>0){
|
||||
if (config.debug.rhizome)
|
||||
DEBUGF("Copying %"PRId64" bytes from previous journal", length);
|
||||
rhizome_journal_pipe(&slot->write_state, &slot->previous->filehash, start, length);
|
||||
|
@ -821,7 +821,7 @@ int rhizome_read_buffered(struct rhizome_read *read, struct rhizome_read_buffer
|
||||
|
||||
// if we can supply either the beginning or end of the data from cache, do that first.
|
||||
uint64_t ofs=read->offset - buffer->offset;
|
||||
if (ofs>=0 && ofs<=buffer->len){
|
||||
if (ofs<=buffer->len){
|
||||
int size=len;
|
||||
if (size > buffer->len - ofs)
|
||||
size = buffer->len - ofs;
|
||||
|
@ -56,7 +56,7 @@ int main(int argc, char **argv)
|
||||
for (i = 1; i < argc; ++i) {
|
||||
const char *arg = argv[i];
|
||||
if (str_startswith(arg, "--size=", &arg)) {
|
||||
if (!str_to_uint64_scaled(arg, 10, &size, NULL) || size < 0)
|
||||
if (!str_to_uint64_scaled(arg, 10, &size, NULL))
|
||||
fatal("illegal --size= argument: %s", arg);
|
||||
}
|
||||
else if (str_startswith(arg, "--label=", &arg))
|
||||
|
Loading…
x
Reference in New Issue
Block a user