Update AMTL; replace AutoPtr/UniquePtr with STL.
This commit is contained in:
@@ -30,8 +30,10 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "common_logic.h"
|
||||
#include <am-autoptr.h>
|
||||
#include <am-moveable.h>
|
||||
#include <am-refcounting.h>
|
||||
#include <sm_stringhashmap.h>
|
||||
@@ -182,7 +184,7 @@ struct TrieSnapshot
|
||||
}
|
||||
|
||||
size_t length;
|
||||
ke::AutoPtr<int[]> keys;
|
||||
std::unique_ptr<int[]> keys;
|
||||
BaseStringTable strings;
|
||||
};
|
||||
|
||||
@@ -557,7 +559,7 @@ static cell_t CreateTrieSnapshot(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
TrieSnapshot *snapshot = new TrieSnapshot;
|
||||
snapshot->length = pTrie->map.elements();
|
||||
snapshot->keys = ke::MakeUnique<int[]>(snapshot->length);
|
||||
snapshot->keys = std::make_unique<int[]>(snapshot->length);
|
||||
size_t i = 0;
|
||||
for (StringHashMap<Entry>::iterator iter = pTrie->map.iter(); !iter.empty(); iter.next(), i++)
|
||||
snapshot->keys[i] = snapshot->strings.AddString(iter->key.chars(), iter->key.length());
|
||||
|
||||
Reference in New Issue
Block a user