1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Optimizations, switching CanImplicitlyCast method, new CPU rate checker

This commit is contained in:
Brian Fiete 2019-11-19 09:58:35 -08:00
parent 39fd8d2624
commit 098ad1ce55
25 changed files with 759 additions and 301 deletions

View file

@ -217,7 +217,7 @@ public:
BF_ASSERT((uintptr)idx < (uintptr)this->mSize);
return this->mVals[idx];
}
bool operator==(const SizedArrayBase& arrB) const
{
if (this->mSize != arrB.mSize)
@ -288,6 +288,11 @@ public:
this->mSize = 0;
}
void Clear()
{
this->mSize = 0;
}
/*void Free()
{
if (this->mVals != NULL)
@ -1060,17 +1065,27 @@ public:
}
};
template <typename T>
static bool operator==(const ArrayBase<T>& arrA, const SizedArrayBase<T>& arrB)
{
if (arrA.mSize != arrB.mSize)
return false;
for (intptr i = 0; i < arrA.mSize; i++)
if (arrA.mVals[i] != arrB.mVals[i])
return false;
return true;
}
NS_BF_END;
/*namespace std
namespace std
{
template<typename T>
struct hash<Beefy::Array<T> >
struct hash<Beefy::SizedArrayImpl<T> >
{
size_t operator()(const Beefy::Array<T>& val) const
size_t operator()(const Beefy::SizedArrayImpl<T>& val) const
{
return _Hash_seq((const uint8*)val.mVals, sizeof(T) * val.mSize);
return HashBytes((const uint8*)val.mVals, sizeof(T) * val.mSize);
}
};
}*/
}