Skip to content

Commit 8f42907

Browse files
committed
more
1 parent 1e2bba7 commit 8f42907

File tree

4 files changed

+6
-23
lines changed

4 files changed

+6
-23
lines changed

worker/include/RTC/SCTP/Packet.hpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ namespace RTC
187187
void AddChunk(const Chunk* chunk);
188188

189189
private:
190-
virtual void InitializeHeader() final;
190+
void InitializeHeader();
191191

192192
/**
193193
* NOTE: Return CommonHeader* instead of const CommonHeader* since we may
@@ -198,14 +198,9 @@ namespace RTC
198198
return reinterpret_cast<CommonHeader*>(const_cast<uint8_t*>(GetBuffer()));
199199
}
200200

201-
const uint8_t* GetChunksPointer() const
201+
uint8_t* GetChunksPointer() const
202202
{
203-
return GetBuffer() + Packet::CommonHeaderLength;
204-
}
205-
206-
virtual uint8_t* GetEndPointer() const final
207-
{
208-
return const_cast<uint8_t*>(GetBuffer()) + GetLength();
203+
return const_cast<uint8_t*>(GetBuffer()) + Packet::CommonHeaderLength;
209204
}
210205

211206
/**

worker/src/RTC/SCTP/Packet.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ namespace RTC
292292
size_t length = GetLength() + chunk->GetLength();
293293

294294
// Let's append the chunk at the end of existing chunks.
295-
auto* clonedChunk = chunk->Clone(GetEndPointer(), chunk->GetLength());
295+
auto* clonedChunk =
296+
chunk->Clone(const_cast<uint8_t*>(GetBuffer()) + GetLength(), chunk->GetLength());
296297

297298
// Freeze the cloned chunk.
298299
clonedChunk->Freeze();

worker/test/include/RTC/TestSerializable/FooItem.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,10 @@ class FooItem : public Serializable
166166
GetHeaderPointer()->valueLength = valueLength;
167167
}
168168

169-
/**
170-
* NOTE: Return uint8_t* instead of const uint8_t* since we may want to
171-
* modify its value.
172-
*/
173169
virtual uint8_t* GetValuePointer() const final
174170
{
175171
return const_cast<uint8_t*>(GetBuffer()) + FooItem::ItemHeaderLength;
176172
}
177-
178-
virtual uint8_t* GetEndPointer() const final
179-
{
180-
return const_cast<uint8_t*>(GetBuffer()) + FooItem::ItemHeaderLength + GetValueLength();
181-
}
182173
};
183174

184175
#endif

worker/test/include/RTC/TestSerializable/FooPacket.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,8 @@ class FooPacket : public Serializable
187187
void AddTextItem(uint8_t flags, const std::string& text);
188188

189189
private:
190-
virtual void InitializeHeader(uint8_t type, uint16_t length) final;
190+
void InitializeHeader(uint8_t type, uint16_t length);
191191

192-
/**
193-
* NOTE: Return Header* instead of const Header* since we may want to
194-
* modify its fields.
195-
*/
196192
Header* GetHeaderPointer() const
197193
{
198194
return reinterpret_cast<Header*>(const_cast<uint8_t*>(GetBuffer()));

0 commit comments

Comments
 (0)