Bladeren bron

Add comments to FindObjectByID

ApisNecros 1 jaar geleden
bovenliggende
commit
3e00fed52c
1 gewijzigde bestanden met toevoegingen van 7 en 0 verwijderingen
  1. 7 0
      5/5_1.ts

+ 7 - 0
5/5_1.ts

@@ -131,6 +131,13 @@ function ParseSourceDestinationRange(lineNumber: number, almanac: string[]): Map
     return rangeMap;
 }
 
+/**
+ * Find an IdentifiableObject by its ID number
+ *
+ * @param needle The ID number to find
+ * @param haystack The list to find the ID in
+ * @returns {IdentifiableObject|undefined} The object by that ID if found, or undefined
+ */
 function FindObjectByID(needle: number, haystack: IdentifiableObject[]): IdentifiableObject|undefined {
     return haystack.find((obj) => obj.ID == needle);
 }