diff options
Diffstat (limited to 'core/dvector.h')
-rw-r--r-- | core/dvector.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/dvector.h b/core/dvector.h index cac9e8ef85..456be41289 100644 --- a/core/dvector.h +++ b/core/dvector.h @@ -34,6 +34,7 @@ #include "pool_allocator.h" #include "safe_refcount.h" #include "os/rw_lock.h" +#include "ustring.h" struct MemoryPool { @@ -89,7 +90,7 @@ class PoolVector { if (!alloc) return; - ERR_FAIL_COND(alloc->lock>0); +// ERR_FAIL_COND(alloc->lock>0); should not be illegal to lock this for copy on write, as it's a copy on write after all if (alloc->refcount.get()==1) return; //nothing to do @@ -466,6 +467,16 @@ public: return OK; } + String join(String delimiter) { + String rs = ""; + int s = size(); + Read r = read(); + for(int i=0;i<s;i++) { + rs += r[i] + delimiter; + } + rs.erase( rs.length()-delimiter.length(), delimiter.length()); + return rs; + } bool is_locked() const { return alloc && alloc->lock>0; } |