提交 90848adc 编写于 作者: A Alexey Milovidov

Fixed translation [#CLICKHOUSE-2].

上级 22d90fcc
......@@ -286,8 +286,8 @@ void TinyLogBlockOutputStream::writeSuffix()
done = true;
/// Finish write.
for (FileStreams::iterator it = streams.begin(); it != streams.end(); ++it)
it->second->finalize();
for (auto & stream : streams)
stream.second->finalize();
std::vector<Poco::File> column_files;
for (auto & pair : streams)
......
......@@ -102,12 +102,12 @@ Formatting
.. code-block:: cpp
template <typename T, typename Ptr = std::shared_ptr<T>>
template <typename T>
class MultiVersion
{
public:
/// Конкретная версия объекта для использования. shared_ptr определяет время жизни версии.
using Version = Ptr;
/// Version of object for usage. shared_ptr manage lifetime of version.
using Version = std::shared_ptr<const T>;
#. If there's only one namespace in a file and there's nothing else significant - no need to indent the namespace.
......@@ -116,12 +116,9 @@ Formatting
.. code-block:: cpp
/// Если файлы не открыты, то открываем их.
if (streams.empty())
for (const auto & name : column_names)
streams.emplace(name, std::make_unique<Stream>(
storage.files[name].data_file.path(),
storage.files[name].marks[mark_number].offset));
/// Finish write.
for (auto & stream : streams)
stream.second->finalize();
#. No spaces before end of line.
......@@ -511,7 +508,7 @@ How to write code
#. Numeric types.
Use types UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64, as well as size_t, ssize_t, ptrdiff_t.
Do not use типы signed/unsigned long, long long, short; signed char, unsigned char, аnd char.
Do not use signed/unsigned long, long long, short; signed char, unsigned char, аnd char.
#. Passing arguments.
Pass complex values by reference (including std::string).
......
......@@ -79,12 +79,12 @@
14. В классах и структурах, public, private, protected пишется на том же уровне, что и class/struct, а все остальные внутренности - глубже.
```cpp
template <typename T, typename Ptr = std::shared_ptr<T>>
template <typename T>
class MultiVersion
{
public:
/// Конкретная версия объекта для использования. shared_ptr определяет время жизни версии.
using Version = Ptr;
/// Version of object for usage. shared_ptr manage lifetime of version.
using Version = std::shared_ptr<const T>;
...
}
```
......@@ -92,12 +92,9 @@
16. Если блок для выражения if, for, while... состоит из одного statement-а, то фигурные скобки писать не обязательно. Вместо этого поместите statement на отдельную строку. Этим statement-ом также может быть вложенный if, for, while... Но если внутренний statement содержит фигурные скобки или else, то у внешнего блок следует писать в фигурных скобках.
```cpp
/// Если файлы не открыты, то открываем их.
if (streams.empty())
for (const auto & name : column_names)
streams.emplace(name, std::make_unique<Stream>(
storage.files[name].data_file.path(),
storage.files[name].marks[mark_number].offset));
/// Finish write.
for (auto & stream : streams)
stream.second->finalize();
```
17. Не должно быть пробелов на концах строк.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册