mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-26 06:18:23 +00:00
Fix non-const version of Common::String::begin.
Common::String::begin now assures the storage is a unique one, i.e. there are no other Common::String objects pointing at it. This allows for safe use of the writable iterators (and thus fixes the test case added with my last commit) svn-id: r49323
This commit is contained in:
parent
0e9156c7c4
commit
f02e31f2fc
@ -222,6 +222,12 @@ public:
|
||||
typedef const char * const_iterator;
|
||||
|
||||
iterator begin() {
|
||||
// Since the user could potentionally
|
||||
// change the string via the returned
|
||||
// iterator we have to assure we are
|
||||
// pointing to an unique storage.
|
||||
makeUnique();
|
||||
|
||||
return _str;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user