assistant-sdk-cpp icon indicating copy to clipboard operation
assistant-sdk-cpp copied to clipboard

Simplify some C++

Open mpoullet opened this issue 6 years ago • 0 comments

  • Enable warnings when compiling.
  • Read and send 16kB when using files. #48
    • change chunk_size and the delay accordingly
    • use std::make_shared to avoid calling new
    • use std::vector::data to access the underlying array
  • u_char is not a standard type. #52
  • Simplify smart pointers use.
    • prefer using std::make_shared when possible
    • use std::vector::data to access the underlying array
    • no need to call .get() on a smart pointer when comparing to nullptr
    • avoid using std::move when not required
    • use type aliasing to improve readability
    • avoid calling std::unique_ptr::reset when not needed
    • audio_output_alsa.cc: no need to put std::thread in a std::unique_ptr

mpoullet avatar Nov 07 '18 14:11 mpoullet