Skip to content

Commit

Permalink
Fix logic to compare compute setting to static counterparts, rather t…
Browse files Browse the repository at this point in the history
…han evaluating static ComputeSetting directly
  • Loading branch information
QuitCrypto committed Dec 4, 2024
1 parent df08538 commit 1a1301c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export class ComputerEVM extends EVMViewFunctionBase implements IComputerEVM {
this.validateComputeSetting(computeSetting)

try {
const mapper = ComputeSetting.OnlyReduce
const mapper = computeSetting === ComputeSetting.OnlyReduce
? (this.logger.info('OnlyReduce setting is used. Skipping map step.'),
(r: RequestResponsePair) => r.response)
: (r: RequestResponsePair) => this.lzMap(compute, r, timeMarker)
const reducer = ComputeSetting.OnlyMap
const reducer = computeSetting === ComputeSetting.OnlyMap
? (this.logger.info('OnlyMap setting is used. Skipping reduce step.'),
(mappedResponses: string[]) => mappedResponses.join(''))
: (mappedResponses: string[]) => this.lzReduce(compute, cmd, mappedResponses, timeMarker)
Expand Down

0 comments on commit 1a1301c

Please sign in to comment.