Skip to content

Commit

Permalink
In Actions, get filename via instance variable
Browse files Browse the repository at this point in the history
No need to use the getter
  • Loading branch information
carlhoerberg committed Dec 29, 2024
1 parent 484a261 commit 1fbb459
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lavinmq/clustering/actions.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ module LavinMQ

def lag_size : Int64
if mfile = @mfile
0i64 + sizeof(Int32) + filename.bytesize +
0i64 + sizeof(Int32) + @filename.bytesize +
sizeof(Int64) + mfile.size.to_i64
else
0i64 + sizeof(Int32) + filename.bytesize +
sizeof(Int64) + File.size(File.join(@data_dir, filename)).to_i64
0i64 + sizeof(Int32) + @filename.bytesize +
sizeof(Int64) + File.size(File.join(@data_dir, @filename)).to_i64
end
end

Expand Down Expand Up @@ -69,7 +69,7 @@ module LavinMQ
in UInt32, Int32
4i64
end
0i64 + sizeof(Int32) + filename.bytesize +
0i64 + sizeof(Int32) + @filename.bytesize +
sizeof(Int64) + datasize
end

Expand Down Expand Up @@ -100,7 +100,7 @@ module LavinMQ
# Maybe it would be ok to not include delete action in lag, because
# the follower should have all info necessary to GC the file during
# startup?
(sizeof(Int32) + filename.bytesize + sizeof(Int64)).to_i64
(sizeof(Int32) + @filename.bytesize + sizeof(Int64)).to_i64
end

def send(socket, log = Log) : Int64
Expand Down

0 comments on commit 1fbb459

Please sign in to comment.