FIND YOUR NEXT FEW LINES

Results for “Promise.all”

Small, practical examples. Search by task or narrow things down below.

1131 snippets foundClear filters
ReactState & reducers

Centralize state changes in a reducer

Centralize state changes in a reducer with a small React component and explicit browser behavior.

React✓ Tested
CStrings & byte buffers

Check a literal filename suffix

C: Check lengths before subtracting so a short input cannot produce an invalid pointer.

C✓ Tested
C++Text validation & parsing

Check a literal prefix in C++17

C++: Use string compare because starts_with was introduced after C++17.

C++✓ Tested
CStrings & byte buffers

Check a literal string prefix

C: strncmp compares at most the prefix length; both inputs must be valid strings.

C✓ Tested
C++Text validation & parsing

Check a literal suffix in C++17

C++: Check lengths before subtracting to avoid an unsigned underflow.

C++✓ Tested
C++Numeric parsing & calculations

Check an upper integer bound before adding

C++: For these nonnegative values, compare against the maximum minus the addend first.

C++✓ Tested
Bash ScriptsArray operations

Check exact array membership

Bash Scripts: Compare each element literally instead of searching a concatenated string.

Bash Scripts✓ Tested
CNumeric parsing & arithmetic

Check positive integer addition before performing it

C: Check the upper boundary before adding two known nonnegative integers.

C✓ Tested
Docker / ComposeImage management

Check that an image has layer history

Docker / Compose: history shows the instructions associated with image layers.

Docker / Compose✓ Tested
C++Tasks & synchronization

Check whether a future is ready without blocking

C++: A zero-duration wait reports timeout until the producer sets a value.

C++✓ Tested
C++Ordering & set operations

Check whether a range is already sorted

C++: is_sorted reports ordering without modifying the input.

C++✓ Tested
Docker / ComposeCompose service options

Choose a service’s internal hostname

Docker / Compose: hostname controls the name reported inside the container.

Docker / Compose✓ Tested