mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[8496] Resolve some #include cycles and unsafe code.
* Common.h -> Threading.h -> Errors.h -> Common.h * Remove reduncdent #include "ByteBuffer.h" in headers * Remove redundent #include "Auth/BigNumber.h" in headers * Avoid multyply data copy at use some now dropped functions in BigNumber. * Avoid copy fixed byte count from byte arrays with unknown real size created from BigNumber.
This commit is contained in:
parent
b276b05363
commit
50d426e72c
13 changed files with 12 additions and 27 deletions
|
|
@ -186,21 +186,6 @@ uint8 *BigNumber::AsByteArray(int minSize)
|
|||
return _array;
|
||||
}
|
||||
|
||||
ByteBuffer BigNumber::AsByteBuffer()
|
||||
{
|
||||
ByteBuffer ret(GetNumBytes());
|
||||
ret.append(AsByteArray(), GetNumBytes());
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<uint8> BigNumber::AsByteVector()
|
||||
{
|
||||
std::vector<uint8> ret;
|
||||
ret.resize(GetNumBytes());
|
||||
memcpy(&ret[0], AsByteArray(), GetNumBytes());
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char *BigNumber::AsHexStr()
|
||||
{
|
||||
return BN_bn2hex(_bn);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue