diff options
| author | Matthias Radestock <matthias@lshift.net> | 2009-08-29 07:13:18 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2009-08-29 07:13:18 +0100 |
| commit | dcafc316efe0148b2aeb3eea62ae03f0ceef688c (patch) | |
| tree | a98afdf4a018d481a5ae7a3253ad53c1d76ccc6f | |
| parent | 118b4e381e592088e83cf3397efe18febdec6ad2 (diff) | |
| download | rabbitmq-server-git-dcafc316efe0148b2aeb3eea62ae03f0ceef688c.tar.gz | |
refactoring: simplify match in read_next_file_entry
this is equivalent since the read entities are unsigned
| -rw-r--r-- | src/rabbit_disk_queue.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_disk_queue.erl b/src/rabbit_disk_queue.erl index 0f08b04c0d..22c57fe36f 100644 --- a/src/rabbit_disk_queue.erl +++ b/src/rabbit_disk_queue.erl @@ -1982,9 +1982,9 @@ read_next_file_entry(FileHdl, Offset) -> case file:read(FileHdl, TwoIntegers) of {ok, <<TotalSize:?INTEGER_SIZE_BITS, MsgIdBinSize:?INTEGER_SIZE_BITS>>} -> - case {TotalSize =< 0, MsgIdBinSize =< 0} of - {true, _} -> eof; %% Nothing we can do other than stop - {false, true} -> + case {TotalSize, MsgIdBinSize} of + {0, _} -> eof; %% Nothing we can do other than stop + {_, 0} -> %% current message corrupted, try skipping past it ExpectedAbsPos = Offset + ?FILE_PACKING_ADJUSTMENT + TotalSize, @@ -1995,7 +1995,7 @@ read_next_file_entry(FileHdl, Offset) -> eof; %% seek failed, so give up KO -> KO end; - {false, false} -> %% all good, let's continue + {_, _} -> %% all good, let's continue case file:read(FileHdl, MsgIdBinSize) of {ok, <<MsgId:MsgIdBinSize/binary>>} -> ExpectedAbsPos = Offset + ?FILE_PACKING_ADJUSTMENT + |
