mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Change ASTContext::allocate(unsigned) to return a MutableArrayRef.
...rather than a raw pointer that points to a buffer with space for N elements. Just because we *can* get N from context doesn't mean it's convenient/safe. No functionality change. Swift SVN r11488
This commit is contained in:
@@ -809,8 +809,8 @@ Optional<MutableArrayRef<Decl *>> ModuleFile::readMembers() {
|
||||
return MutableArrayRef<Decl *>();
|
||||
|
||||
ASTContext &ctx = getContext();
|
||||
MutableArrayRef<Decl *> members(ctx.Allocate<Decl *>(rawMemberIDs.size()),
|
||||
rawMemberIDs.size());
|
||||
MutableArrayRef<Decl *> members = ctx.Allocate<Decl *>(rawMemberIDs.size());
|
||||
|
||||
auto nextMember = members.begin();
|
||||
for (DeclID rawID : rawMemberIDs) {
|
||||
*nextMember = getDecl(rawID);
|
||||
|
||||
Reference in New Issue
Block a user