slight cleanup
This commit is contained in:
parent
361be65a93
commit
a1ad90c511
1 changed files with 9 additions and 11 deletions
|
|
@ -1,6 +1,13 @@
|
|||
import { getInstallationOctokitByOwner } from "../github/github-utils"
|
||||
import { githubApp } from "../github/github-app"
|
||||
|
||||
function updateOptimizationsDict(dict: { [key: string]: [string] }, path: string, funcName: string) {
|
||||
if (path in dict) {
|
||||
dict[path].push(funcName);
|
||||
} else {
|
||||
dict[path] = [funcName];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function verifyExistingOptimizations(req, res) {
|
||||
|
|
@ -31,11 +38,7 @@ export async function verifyExistingOptimizations(req, res) {
|
|||
const split = line.split(" ")
|
||||
const function_name: string = split[2].replace("`", "").replace("`", "")
|
||||
const file_path: string = split[4].replace("`", "").replace("`", "")
|
||||
if (file_path in optimizations_dict) {
|
||||
optimizations_dict[file_path].push(function_name)
|
||||
} else {
|
||||
optimizations_dict[file_path] = [function_name]
|
||||
}
|
||||
updateOptimizationsDict(optimizations_dict, file_path, function_name);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -61,12 +64,7 @@ export async function verifyExistingOptimizations(req, res) {
|
|||
const split = line.split(" ")
|
||||
const function_name: string = split[2].replace("`", "").replace("`", "")
|
||||
const file_path: string = split[4].replace("`", "").replace("`", "")
|
||||
|
||||
if (file_path in optimizations_dict) {
|
||||
optimizations_dict[file_path].push(function_name)
|
||||
} else {
|
||||
optimizations_dict[file_path] = [function_name]
|
||||
}
|
||||
updateOptimizationsDict(optimizations_dict, file_path, function_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue