mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[11261] Get rid of two const_casts by storing const char* instead of char*
This commit is contained in:
parent
b588ea9db3
commit
df89544baa
2 changed files with 6 additions and 6 deletions
|
|
@ -35,7 +35,7 @@ class Field
|
|||
};
|
||||
|
||||
Field() : mValue(NULL), mType(DB_TYPE_UNKNOWN) {}
|
||||
Field(const char *value, enum DataTypes type) : mType(type) { mValue = const_cast<char * >(value); }
|
||||
Field(const char* value, enum DataTypes type) : mValue(value), mType(type) {}
|
||||
|
||||
~Field() {}
|
||||
|
||||
|
|
@ -69,13 +69,13 @@ class Field
|
|||
void SetType(enum DataTypes type) { mType = type; }
|
||||
//no need for memory allocations to store resultset field strings
|
||||
//all we need is to cache pointers returned by different DBMS APIs
|
||||
void SetValue(const char *value) { mValue = const_cast<char * >(value); };
|
||||
void SetValue(const char* value) { mValue = value; };
|
||||
|
||||
private:
|
||||
Field(Field &f);
|
||||
Field& operator=(const Field& );
|
||||
Field(Field const&);
|
||||
Field& operator=(Field const&);
|
||||
|
||||
char *mValue;
|
||||
const char* mValue;
|
||||
enum DataTypes mType;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue