Skip to content

Commit f6dfe12

Browse files
[Codemod][CppQualityDownToZero] Fix CQS signal readability-braces-around-statements in fbcode/pytorch/audio
Differential Revision: D78876483 Pull Request resolved: #3990
1 parent b6a3368 commit f6dfe12

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/libtorchaudio/sox/types.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,25 +68,32 @@ std::string to_string(Encoding v) {
6868
}
6969

7070
Encoding get_encoding_from_option(const std::optional<std::string>& encoding) {
71-
if (!encoding.has_value())
71+
if (!encoding.has_value()) {
7272
return Encoding::NOT_PROVIDED;
73+
}
7374
std::string v = encoding.value();
74-
if (v == "PCM_S")
75+
if (v == "PCM_S") {
7576
return Encoding::PCM_SIGNED;
76-
if (v == "PCM_U")
77+
}
78+
if (v == "PCM_U") {
7779
return Encoding::PCM_UNSIGNED;
78-
if (v == "PCM_F")
80+
}
81+
if (v == "PCM_F") {
7982
return Encoding::PCM_FLOAT;
80-
if (v == "ULAW")
83+
}
84+
if (v == "ULAW") {
8185
return Encoding::ULAW;
82-
if (v == "ALAW")
86+
}
87+
if (v == "ALAW") {
8388
return Encoding::ALAW;
89+
}
8490
TORCH_CHECK(false, "Internal Error: unexpected encoding value: ", v);
8591
}
8692

8793
BitDepth get_bit_depth_from_option(const std::optional<int64_t>& bit_depth) {
88-
if (!bit_depth.has_value())
94+
if (!bit_depth.has_value()) {
8995
return BitDepth::NOT_PROVIDED;
96+
}
9097
int64_t v = bit_depth.value();
9198
switch (v) {
9299
case 8:

0 commit comments

Comments
 (0)