================
@@ -1,48 +1,22 @@
-// Append using posix-style a file name or directory to Base
-function append(Base, New) {
-  if (!New)
-    return Base;
-  if (Base)
-    Base += "/";
-  Base += New;
-  return Base;
-}
-
-// Get relative path to access FilePath from CurrentDirectory
-function computeRelativePath(FilePath, CurrentDirectory) {
-  var Path = FilePath;
-  while (Path) {
-    if (CurrentDirectory == Path)
-      return FilePath.substring(Path.length + 1);
-    Path = Path.substring(0, Path.lastIndexOf("/"));
+function genLink(Ref) {
+  var Path = 
`${window.location.protocol}//${window.location.host}/${Ref.Path}`;
+  if (Ref.RefType !== "namespace") {
+    if (Ref.Path === "") {
+      Path = `${Path}${Ref.Name}.html`;
+    }
+    else {
+      Path = `${Path}/${Ref.Name}.html`;
+    }
----------------
ilovepi wrote:

I don't think this can be right, can it? The `if` and `else` have the same 
body. These branches used to retuern `index.html` or `${Path}${Ref.Name}.html`. 
Either the old behavior was correct, or this should be simplified to:

```suggestion
  if (Ref.RefType !== "namespace") {
      Path = `${Path}${Ref.Name}.html`;
```

https://github.com/llvm/llvm-project/pull/93281
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to