String object, len is of type unsigned int, however indexOf() and lastIndexOf() return int

オープン
#239 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
cpp
領域
api, embedded-iot

調査の方向性

ArduinoCore-API の String 実装で indexOf() と lastIndexOf() の宣言および実装を検索し、それらの戻り値の型を len、charAt()、substring()、remove()、reserve() と比較します。両方のメソッドが意図された unsigned 型を一貫して使用していること、また結果を substring() に渡す呼び出し側でキャストが不要になっていることを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug
Description

String Object:

len is of type unsigned int.
method that apply to position into the String or its size are expecting an unsigned int, this is the case with:
charAt()
substring()
remove()
reserve()

Oddly, indexOf() and lastIndexOf() are returning int and not unsigned int

Current behavior

Oddly, indexOf() and lastIndexOf() are returning int and not unsigned int

Expected behavior

indexOf() and lastIndexOf() ought to return unsigned int, to avoid unnecessary casting from int to unsigned int

Additional information

It's frequent to pass the result of indexOf() to substring()

Thanks

主要言語
C++
スター
306
フォーク
150
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

arduino/ArduinoCore-API のほかの issue

arduino/ArduinoCore-API の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。