[MONGOCRYPT-422] Replace mongocrypt_ctx_t::nothing_to_do Created: 23/Apr/22  Updated: 25/Oct/22

Status: Backlog
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Trivial - P5
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Binding Changes: Not Needed

 Description   

Background & Motivation
mongocrypt_ctx_t::nothing_to_do is an optimization to avoid an extra copy when no encryption or decryption is required. It is vaguely named.

nothing_to_do is set to true under these conditions:
1. No keys are requested
2. The command is bypassed for automatic encryption (e.g. ping).
3. bypass_query_analysis is true.

The assumptions about what is safe to access when nothing_to_do is false are not immediately obvious.

Scope

  • Rename nothing_to_do to has_markings.
  • Only set has_markings to true if traversing a document encounters markings to process.

Generated at Thu Feb 08 09:08:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.