changed irrArray::linear_search to use == operator to avoid false positives.
changed operators on classes that used linear_search (only used in string comparisons) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@742 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
97b6ac7a7c
commit
323182d605
|
@ -1,5 +1,10 @@
|
|||
Changes in version 1.4 (... 2007)
|
||||
|
||||
- Changed irrArray::linear_search to use the == operator rather than <
|
||||
This may be slower in some cases, but it no longer returns false positives
|
||||
when searching arrays of classes that override the < operator but
|
||||
!(x<y) && !(y<x) does not necessarily mean x==y (vectors, positions etc).
|
||||
|
||||
- Fixed getSize/getOriginalSize method inversion in OpenGL textures.
|
||||
|
||||
- Added per texture-layer filter settings, i.e. one can choose to filter
|
||||
|
|
|
@ -194,9 +194,9 @@ namespace scene
|
|||
core::vector3df position;
|
||||
core::quaternion rotation;
|
||||
|
||||
bool operator < ( const SMD3QuaterionTag &other ) const
|
||||
bool operator == ( const SMD3QuaterionTag &other ) const
|
||||
{
|
||||
return Name < other.Name;
|
||||
return Name == other.Name;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -53,9 +53,9 @@ namespace quake3
|
|||
return name.size();
|
||||
}
|
||||
|
||||
bool operator < ( const SVariable &other ) const
|
||||
bool operator == ( const SVariable &other ) const
|
||||
{
|
||||
return name < other.name;
|
||||
return name == other.name;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -444,9 +444,14 @@ namespace quake3
|
|||
class SShader
|
||||
{
|
||||
public:
|
||||
bool operator == (const SShader &other ) const
|
||||
{
|
||||
return name == other.name;
|
||||
}
|
||||
|
||||
bool operator < (const SShader &other ) const
|
||||
{
|
||||
return name < other.name;
|
||||
return name < other.name;
|
||||
}
|
||||
|
||||
const SVarGroup * getGroup ( u32 stage ) const
|
||||
|
|
|
@ -426,7 +426,7 @@ public:
|
|||
s32 linear_search(const T& element) const
|
||||
{
|
||||
for (u32 i=0; i<used; ++i)
|
||||
if (!(element < data[i]) && !(data[i] < element))
|
||||
if (element == data[i])
|
||||
return (s32)i;
|
||||
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue