mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 13:40:11 +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)
|
if (s.semanticRun == PASS.init)
|
||||||
s.dsymbolSemantic(null);
|
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);
|
assert(protName);
|
||||||
auto se = new StringExp(e.loc, protName[0 .. strlen(protName)]);
|
auto se = new StringExp(e.loc, protName);
|
||||||
return se.expressionSemantic(sc);
|
return se.expressionSemantic(sc);
|
||||||
}
|
}
|
||||||
if (e.ident == Id.parent)
|
if (e.ident == Id.parent)
|
||||||
|
@ -1029,9 +1029,7 @@ Expression semanticTraits(TraitsExp e, Scope* sc)
|
||||||
*/
|
*/
|
||||||
void insertInterfaceInheritedFunction(FuncDeclaration fd, Expression e)
|
void insertInterfaceInheritedFunction(FuncDeclaration fd, Expression e)
|
||||||
{
|
{
|
||||||
auto funcType = fd.type.toChars();
|
auto signature = fd.type.toString();
|
||||||
auto len = strlen(funcType);
|
|
||||||
string signature = funcType[0 .. len].idup;
|
|
||||||
//printf("%s - %s\n", fd.toChars, signature);
|
//printf("%s - %s\n", fd.toChars, signature);
|
||||||
if (signature !in funcTypeHash)
|
if (signature !in funcTypeHash)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue