mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Very minor channel / variant performance improvements and cleanup.
This commit is contained in:
+16
-14
@@ -35,6 +35,19 @@ class Variant
|
||||
{
|
||||
public:
|
||||
|
||||
enum Type
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
BOOLEAN,
|
||||
NUMBER,
|
||||
STRING,
|
||||
SMALLSTRING,
|
||||
LUSERDATA,
|
||||
FUSERDATA,
|
||||
NIL,
|
||||
TABLE
|
||||
};
|
||||
|
||||
Variant();
|
||||
Variant(bool boolean);
|
||||
Variant(double number);
|
||||
@@ -48,7 +61,9 @@ public:
|
||||
|
||||
Variant &operator = (const Variant &v);
|
||||
|
||||
static bool fromLua(lua_State *L, int n, Variant *v, bool allowTables = true);
|
||||
Type getType() const { return type; }
|
||||
|
||||
static Variant fromLua(lua_State *L, int n, bool allowTables = true);
|
||||
void toLua(lua_State *L) const;
|
||||
|
||||
private:
|
||||
@@ -83,19 +98,6 @@ private:
|
||||
std::vector<std::pair<Variant, Variant>> *table;
|
||||
};
|
||||
|
||||
enum Type
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
BOOLEAN,
|
||||
NUMBER,
|
||||
STRING,
|
||||
SMALLSTRING,
|
||||
LUSERDATA,
|
||||
FUSERDATA,
|
||||
NIL,
|
||||
TABLE
|
||||
};
|
||||
|
||||
static const int MAX_SMALL_STRING_LENGTH = 15;
|
||||
|
||||
Type type;
|
||||
|
||||
Reference in New Issue
Block a user