message: Reduce if block
diff: @@ -103,7 +103,12 @@ export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine {
  });
  });
  - if (items.length) {
  + if (!items.length) {
  + // No items to process, wait and try again.
  + await this.wait();
  + return;
  + }
  +
  const { id, state, unprocessedEntity } = items[0];
  const result = await this.orchestrator.process({
  @@ -131,15 +136,9 @@ export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine {
  const setOfThingsToStitch = new Set<string>([
  stringifyEntityRef(result.completedEntity),
  - ...result.relations.map(relation =>
  - stringifyEntityRef(relation.source),
  - ),
  + ...result.relations.map(relation => stringifyEntityRef(relation.source)),
  ]);
  await this.stitcher.stitch(setOfThingsToStitch);
  - } else {
  - // No items to process, wait and try again.
  - await this.wait();
  - }
  }
  private async wait() {
  