Skip to content

Add braces around single-line control flow statements (#5090)#5090

Open
junjieqi wants to merge 2 commits intomainfrom
export-D100580151
Open

Add braces around single-line control flow statements (#5090)#5090
junjieqi wants to merge 2 commits intomainfrom
export-D100580151

Conversation

@junjieqi
Copy link
Copy Markdown
Contributor

@junjieqi junjieqi commented Apr 13, 2026

Summary:

Fix 136 readability-braces-around-statements lint warnings by adding braces to all single-line if, else, for, and while statements across 4 files: IndexLSH.cpp (14 issues), IndexIVFPQ.cpp (36 issues), IndexPQ.cpp (25 issues), and VectorTransform.cpp (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 13, 2026

@junjieqi has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100580151.

@meta-codesync meta-codesync bot changed the title Add braces around single-line control flow statements Add braces around single-line control flow statements (#5090) Apr 13, 2026
@meta-codesync meta-codesync bot force-pushed the export-D100580151 branch from 29c5ac4 to b030b7a Compare April 13, 2026 17:43
meta-codesync bot pushed a commit that referenced this pull request Apr 13, 2026
Summary:

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
junjieqi added a commit that referenced this pull request Apr 13, 2026
Summary:
Pull Request resolved: #5090

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
@junjieqi junjieqi force-pushed the export-D100580151 branch from b030b7a to 7a2ba97 Compare April 13, 2026 17:46
junjieqi added a commit that referenced this pull request Apr 13, 2026
Summary:
Pull Request resolved: #5090

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
@junjieqi junjieqi force-pushed the export-D100580151 branch from 7a2ba97 to ced71ce Compare April 13, 2026 17:54
meta-codesync bot pushed a commit that referenced this pull request Apr 13, 2026
Summary:

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
@meta-codesync meta-codesync bot force-pushed the export-D100580151 branch from ced71ce to 1dd24f6 Compare April 13, 2026 20:57
junjieqi added a commit that referenced this pull request Apr 13, 2026
Summary:
Pull Request resolved: #5090

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
@junjieqi junjieqi force-pushed the export-D100580151 branch from 1dd24f6 to 57e359a Compare April 13, 2026 21:01
meta-codesync bot pushed a commit that referenced this pull request Apr 13, 2026
Summary:

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
@meta-codesync meta-codesync bot force-pushed the export-D100580151 branch from 57e359a to a7b25ce Compare April 13, 2026 21:04
meta-codesync bot pushed a commit that referenced this pull request Apr 13, 2026
Summary:

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
@meta-codesync meta-codesync bot force-pushed the export-D100580151 branch from a7b25ce to 640fe8f Compare April 13, 2026 21:05
junjieqi added a commit that referenced this pull request Apr 13, 2026
Summary:
Pull Request resolved: #5090

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
@junjieqi junjieqi force-pushed the export-D100580151 branch from 640fe8f to 367fafb Compare April 13, 2026 21:08
junjieqi added a commit that referenced this pull request Apr 13, 2026
Summary:
Pull Request resolved: #5090

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
@junjieqi junjieqi force-pushed the export-D100580151 branch from 367fafb to 8f2f1e6 Compare April 13, 2026 21:30
Summary:

Fix 59 `cppcoreguidelines-pro-type-member-init` lint warnings by adding `{}` value-initialization to uninitialized member fields across 17 files. This ensures all members are zero/null-initialized by default, preventing potential use of uninitialized values.

Affected files: Index.cpp, Index2Layer.cpp, IndexAdditiveQuantizer.cpp, IndexAdditiveQuantizerFastScan.h, IndexBinaryHash.h, IndexBinaryIVF.cpp, IndexFastScan.h, IndexHNSW.h, IndexIVF.h, IndexIVFAdditiveQuantizer.cpp, IndexIVFFastScan.h, IndexIVFFlat.h, IndexIVFPQ.cpp, IndexIVFPQ.h, IndexPQ.cpp, IndexPQ.h, IndexRowwiseMinMax.cpp.

Reviewed By: mnorris11

Differential Revision: D100577736
Summary:

Fix 136 `readability-braces-around-statements` lint warnings by adding braces to all single-line `if`, `else`, `for`, and `while` statements across 4 files: `IndexLSH.cpp` (14 issues), `IndexIVFPQ.cpp` (36 issues), `IndexPQ.cpp` (25 issues), and `VectorTransform.cpp` (61 issues). This improves code readability and prevents bugs from accidentally adding statements to unbraced blocks.

Reviewed By: mnorris11

Differential Revision: D100580151
@meta-codesync meta-codesync bot force-pushed the export-D100580151 branch from 8f2f1e6 to abb3092 Compare April 13, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant