Unverified Commit da1a7cde authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #761 from dwrensha/initialize-enums

initialize anonymous enums in isPlausiblyText() and isPlausiblyJson()
parents 12d346b2 ce4dd5a1
...@@ -1377,7 +1377,7 @@ private: ...@@ -1377,7 +1377,7 @@ private:
} }
Plausibility isPlausiblyText(kj::ArrayPtr<const byte> prefix) { Plausibility isPlausiblyText(kj::ArrayPtr<const byte> prefix) {
enum { PREAMBLE, COMMENT, BODY } state; enum { PREAMBLE, COMMENT, BODY } state = PREAMBLE;
for (char c: prefix.asChars()) { for (char c: prefix.asChars()) {
switch (state) { switch (state) {
...@@ -1427,7 +1427,7 @@ private: ...@@ -1427,7 +1427,7 @@ private:
} }
Plausibility isPlausiblyJson(kj::ArrayPtr<const byte> prefix) { Plausibility isPlausiblyJson(kj::ArrayPtr<const byte> prefix) {
enum { PREAMBLE, COMMENT, BODY } state; enum { PREAMBLE, COMMENT, BODY } state = PREAMBLE;
for (char c: prefix.asChars()) { for (char c: prefix.asChars()) {
switch (state) { switch (state) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment