ドキュメンテーションコメントにComplexity
という項目あります。
/** An example of using the complexity field - complexity: The method demonstrates an inefficient way to sort using an O(N\*N\*N) (order N-cubed) algorithm */
このComplexity
の意味が最初は分からず、「複雑さ?」何を書くんだろう?
と思っていました。
結論としては「計算量」のことだと思われます。
API Design Guideline的にも
「computed propertyでO(1)以外の場合はドキュメンテーションコメントに書きましょう」
と書いているし、この例でもオーダーの話が書いていますね。
いやー、英語は難しいですね、、、
リファレンス
- https://swift.org/documentation/api-design-guidelines/
- https://developer.apple.com/library/mac/documentation/Xcode/Reference/xcode_markup_formatting_ref/Complexity.html
Recent Comments