arduino / arduino/ArduinoCore-API
String object, len is of type unsigned int, however indexOf() and lastIndexOf() return int
- Lingua principale
- C++
- Stelle
- 306
- Fork
- 150
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
### 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
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Cerca nell’implementazione di String di ArduinoCore-API le dichiarazioni e le implementazioni di indexOf() e lastIndexOf(), quindi confronta i relativi tipi restituiti con len, charAt(), substring(), remove() e reserve(). Verifica che entrambi i metodi utilizzino in modo coerente il tipo unsigned previsto e che i chiamanti che passano i loro risultati a substring() non richiedano più un cast.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- api, embedded-iot
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 52/100