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

Refine code

This commit is contained in:
winlin 2020-08-30 10:13:23 +08:00
parent 311cb77b36
commit 7fed6e631a
2 changed files with 7 additions and 7 deletions

View file

@ -52,14 +52,14 @@ bool _SrsContextId::empty() const
return v_.empty(); return v_.empty();
} }
int _SrsContextId::compare(const _SrsContextId& to) const
{
return v_.compare(to.v_);
}
_SrsContextId& _SrsContextId::set_value(const std::string& v) _SrsContextId& _SrsContextId::set_value(const std::string& v)
{ {
v_ = v; v_ = v;
return *this; return *this;
} }
int _SrsContextId::compare(const _SrsContextId& to) const
{
return v_.compare(to.v_);
}

View file

@ -130,13 +130,13 @@ public:
public: public:
const char* c_str() const; const char* c_str() const;
bool empty() const; bool empty() const;
// Set the value of context id.
_SrsContextId& set_value(const std::string& v);
// Compare the two context id. @see http://www.cplusplus.com/reference/string/string/compare/ // Compare the two context id. @see http://www.cplusplus.com/reference/string/string/compare/
// 0 They compare equal // 0 They compare equal
// <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter. // <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter.
// >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer. // >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer.
int compare(const _SrsContextId& to) const; int compare(const _SrsContextId& to) const;
// Set the value of context id.
_SrsContextId& set_value(const std::string& v);
}; };
typedef _SrsContextId SrsContextId; typedef _SrsContextId SrsContextId;
#else #else