MCPcopy Create free account
hub / github.com/sindresorhus/fkill-cli / preferHighPerformanceImpact

Function preferHighPerformanceImpact

interactive.js:57–74  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

55const preferLowAlphanumericNames = (a, b) => a.name.localeCompare(b.name);
56
57const preferHighPerformanceImpact = (a, b) => {
58 const hasCpu = typeof a.cpu === 'number' && typeof b.cpu === 'number';
59 const hasMemory = typeof a.memory === 'number' && typeof b.memory === 'number';
60
61 if (hasCpu && hasMemory) {
62 return numberSortDescending(a.cpu + a.memory, b.cpu + b.memory);
63 }
64
65 if (hasCpu) {
66 return numberSortDescending(a.cpu, b.cpu);
67 }
68
69 if (hasMemory) {
70 return numberSortDescending(a.memory, b.memory);
71 }
72
73 return 0;
74};
75
76const preferHeurisicallyInterestingProcesses = (a, b) => {
77 let result;

Calls

no outgoing calls

Tested by

no test coverage detected