소스 검색

[Fix] Set loaded variable explicitly

tags/3.8.0
Vsevolod Stakhov 6 달 전
부모
커밋
b6612604aa
No account linked to committer's email address
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4
    3
      src/libmime/lang_detection_fasttext.cxx

+ 4
- 3
src/libmime/lang_detection_fasttext.cxx 파일 보기

@@ -40,7 +40,7 @@ class fasttext_langdet {
private:
fasttext::FastText ft;
std::string model_fname;
bool loaded;
bool loaded = false;

public:
explicit fasttext_langdet(struct rspamd_config *cfg)
@@ -124,10 +124,11 @@ public:
return predictions;
}

auto model_info(void) const -> std::string
auto model_info(void) const -> const std::string
{
if (!loaded) {
return "fasttext model is not loaded";
static const auto not_loaded = std::string{"fasttext model is not loaded"};
return not_loaded;
}
else {
return fmt::format("fasttext model {}: {} languages, {} tokens", model_fname,

Loading…
취소
저장