Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iconv: Change convert() return type to const std::string& #1099

Merged
merged 1 commit into from Feb 4, 2023

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Feb 4, 2023

JDLIB::Iconvクラスで使うバッファをstd::vector<char>からstd::stringに変更します。
convert()の引数と戻り値を整理して内部バッファのconst参照を直接返すように修正します。
合わせてconvert()を呼び出すコードを整理します。

`JDLIB::Iconv`クラスで使うバッファを`std::vector<char>`から
`std::string`に変更します。`convert()`の引数と戻り値を整理して
内部バッファのconst参照を直接返すように修正します。合わせて
`convert()`を呼び出すコードを整理します。
@ma8ma ma8ma added the refactoring コードの整理 (バグ修正でも機能変更でもない) label Feb 4, 2023
return m_iconv->convert( rawlines, strlen( rawlines ), byte );
const std::string& result = m_iconv->convert( rawlines, std::strlen( rawlines ) );
byte = result.size();
return result.c_str();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正メモ
ポインターを取り出して関数から返しているので寿命管理に不安、raw2dat()の引数と戻り値を整理する

@ma8ma ma8ma merged commit b0d746c into master Feb 4, 2023
@ma8ma ma8ma deleted the iconv-change-convert-function-return-type branch February 4, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring コードの整理 (バグ修正でも機能変更でもない)
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant