Skip to content

Commit

Permalink
ssh/Serializer: remove unused field skip
Browse files Browse the repository at this point in the history
The Skip() method is unused, and thus we can remove the whole field.
  • Loading branch information
MaxKellermann committed Mar 4, 2024
1 parent 6441743 commit 93126ef
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/ssh/Serializer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ namespace SSH {
struct PacketTooLarge {};

class Serializer {
std::size_t skip = 0, position = 0;
std::size_t position = 0;

protected:
std::array<std::byte, MAX_PACKET_SIZE> buffer;

constexpr std::size_t size() const noexcept {
return position - skip;
return position;
}

public:
Expand Down Expand Up @@ -211,12 +211,8 @@ public:
InsertNullByte(size);
}

constexpr void Skip(std::size_t nbytes) noexcept {
skip += nbytes;
}

constexpr std::span<const std::byte> Finish() noexcept {
return std::span{buffer}.first(position).subspan(skip);
return std::span{buffer}.first(position);
}

private:
Expand Down

0 comments on commit 93126ef

Please sign in to comment.