This commit is contained in:
Dávid Molnár 2024-02-01 16:31:14 +01:00 коммит произвёл GitHub
Родитель b9735965e0
Коммит bfc3f8c3d6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -176,11 +176,14 @@ It causes confusion and awkward catch clauses.
- Bad: `_ = PrevOutsIndex.Remove(txInput.PrevOut);`
- Bad: `_ = Directory.CreateDirectory(dir);`
- Good: `_ = WaitAsync();` - disables warning message. Remark: you should always `await` or store the reference of the task.
- Good: `_ = new HwiClient(network);`
In general
- If the return value is not used, write nothing.
- In cases when the object needs to be disposed, but you do not need the object, `_ =` should be used.
- If it generates a compiler warning, investigate, and if you are sure you can suppress the warning with `_ =` but elaborate on it with a comment.
- In cases when the object needs to be disposed, but you do not need the object, `_ =` should be used.
- In case you want to create an object but do not need the reference, `_ =` should be used.
- If it generates a compiler warning, investigate, and if you are sure you can suppress the warning with `_ =` but elaborate on it with a comment.
- In special cases `_ =` can be used but a reasonable elaboration is required by adding a comment above.
---