Skip to content

Commit

Permalink
Fix the comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
lewing committed Sep 8, 2024
1 parent 9992ff1 commit a179289
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
14 changes: 0 additions & 14 deletions src/mono/browser/runtime/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,6 @@ wasm_dl_symbol (void *handle, const char *name, char **err, void *user_data)
return dlsym (handle, name);
}
#endif

#ifndef WHY_OH_WHY
PinvokeTable* index = (PinvokeTable*)handle;
int i = 0;

Expand All @@ -298,18 +296,6 @@ wasm_dl_symbol (void *handle, const char *name, char **err, void *user_data)
}

return result->func;
#else
PinvokeTable* index = (PinvokeTable*)handle;

for (int i = 0; i < index->count; ++i) {
assert (index->imports [i].name);

if (!strcmp(index->imports[i].name, name))
return index->imports[i].func;

}
return NULL;
#endif
}

MonoDomain *
Expand Down
4 changes: 2 additions & 2 deletions src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ private void EmitPInvokeTable(StreamWriter w, Dictionary<string, string> modules
{
var assemblies_pinvokes = pinvokes
.Where(l => l.Module == module && !l.Skip)
.OrderBy(l => l.EntryPoint)
.GroupBy(d => d.EntryPoint)
.OrderBy(l => l.EntryPoint, StringComparer.Ordinal)
.GroupBy(d => d.EntryPoint, StringComparer.Ordinal)
.Select(l => $"{{\"{EscapeLiteral(l.Key)}\", {CEntryPoint(l.First())}}}, "
+ "// " + string.Join(", ", l.Select(c => c.Method.DeclaringType!.Module!.Assembly!.GetName()!.Name!).Distinct().OrderBy(n => n)) + w.NewLine + " ")
.ToList();
Expand Down

0 comments on commit a179289

Please sign in to comment.