1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

SrsContextId assignment can be improved without create a duplicated one. v5.0.175 (#3503)

SrsContextId object creation can be improved on `srs_protocol_log.cpp`,
No need to create one, then assign it back. It seems a common mistake
for Cpp programmers.

---------

Co-authored-by: john <hondaxiao@tencent.com>
This commit is contained in:
Jacob Su 2023-08-28 15:51:23 +08:00 committed by winlin
parent 8d6b882034
commit cbb5edcc3c
3 changed files with 3 additions and 2 deletions

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_REVISION 174
#define VERSION_REVISION 175
#endif

View file

@ -33,7 +33,7 @@ SrsThreadContext::~SrsThreadContext()
SrsContextId SrsThreadContext::generate_id()
{
SrsContextId cid = SrsContextId();
SrsContextId cid;
return cid.set_value(srs_random_str(8));
}