Skip to content

Commit 028188f

Browse files
committed
Revert "Refactor a bit xr_token"
This reverts commit 2039fc6.
1 parent 9c218b4 commit 028188f

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/xrCommon/xr_string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "xalloc.h"
44

55
// string(char)
6-
using xr_string = std::basic_string<char, std::char_traits<char>, xalloc<char>>;
6+
typedef std::basic_string<char, std::char_traits<char>, xalloc<char>> xr_string;
77

88
inline void xr_strlwr(xr_string& src)
99
{

src/xrCore/xrCore.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,17 @@
9696
// stl ext
9797
struct XRCORE_API xr_rtoken
9898
{
99-
xr_string name;
99+
shared_str name;
100100
int id;
101101

102-
xr_rtoken(const pcstr _nm, const int _id)
102+
xr_rtoken(pcstr _nm, int _id)
103103
{
104104
name = _nm;
105105
id = _id;
106106
}
107107

108-
void rename(const pcstr _nm) { name = _nm; }
109-
bool equal(const pcstr _nm) const
110-
{
111-
return name.compare(_nm) == 0;
112-
}
108+
void rename(pcstr _nm) { name = _nm; }
109+
bool equal(pcstr _nm) const { return (0 == xr_strcmp(*name, _nm)); }
113110
};
114111

115112
#pragma pack(push, 1)

0 commit comments

Comments
 (0)