getTokensUsed static method

int getTokensUsed(
  1. List<Attachment> attachments
)

Implementation

static int getTokensUsed(List<Attachment> attachments) => attachments.fold(0,
    (acc, attachment) => acc + (attachment.active ? attachment.tokens : 0));