From f738981ed50840902eb9c422fca98272a8afffce Mon Sep 17 00:00:00 2001 From: Raman Date: Tue, 5 Jul 2016 22:26:21 +0200 Subject: [PATCH] Update idl_gen_fbs.cpp --- src/idl_gen_fbs.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/idl_gen_fbs.cpp b/src/idl_gen_fbs.cpp index 241a78792..719cb0cf7 100644 --- a/src/idl_gen_fbs.cpp +++ b/src/idl_gen_fbs.cpp @@ -55,16 +55,15 @@ static void GenNameSpace(const Namespace &name_space, std::string *_schema, std::string GenerateFBS(const Parser &parser, const std::string &file_name, const bool &escape_proto_identifiers) { // Proto namespaces may clash with table names, so we have to prefix all: - if (!escape_proto_identifiers) { - for (auto it = parser.namespaces_.begin(); it != parser.namespaces_.end(); - ++it) { - for (auto comp = (*it)->components.begin(); comp != (*it)->components.end(); - ++comp) { - (*comp) = "_" + (*comp); - } + if (!escape_proto_identifiers) { + for (auto it = parser.namespaces_.begin(); it != parser.namespaces_.end(); + ++it) { + for (auto comp = (*it)->components.begin(); comp != (*it)->components.end(); + ++comp) { + (*comp) = "_" + (*comp); } - } - + } + } std::string schema; schema += "// Generated from " + file_name + ".proto\n\n"; if (parser.opts.include_dependence_headers) {