mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
Merge pull request #10582 from StianGulpen/traits-strlen
remove a couple of `strlen()` calls from dmd.traits
This commit is contained in:
commit
d73ce548f9
1 changed files with 3 additions and 5 deletions
|
@ -818,9 +818,9 @@ Expression semanticTraits(TraitsExp e, Scope* sc)
|
|||
if (s.semanticRun == PASS.init)
|
||||
s.dsymbolSemantic(null);
|
||||
|
||||
auto protName = protectionToChars(s.prot().kind); // TODO: How about package(names)
|
||||
auto protName = protectionToString(s.prot().kind); // TODO: How about package(names)
|
||||
assert(protName);
|
||||
auto se = new StringExp(e.loc, protName[0 .. strlen(protName)]);
|
||||
auto se = new StringExp(e.loc, protName);
|
||||
return se.expressionSemantic(sc);
|
||||
}
|
||||
if (e.ident == Id.parent)
|
||||
|
@ -1029,9 +1029,7 @@ Expression semanticTraits(TraitsExp e, Scope* sc)
|
|||
*/
|
||||
void insertInterfaceInheritedFunction(FuncDeclaration fd, Expression e)
|
||||
{
|
||||
auto funcType = fd.type.toChars();
|
||||
auto len = strlen(funcType);
|
||||
string signature = funcType[0 .. len].idup;
|
||||
auto signature = fd.type.toString();
|
||||
//printf("%s - %s\n", fd.toChars, signature);
|
||||
if (signature !in funcTypeHash)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue