Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc88af7b

Browse files
committed
Remove alwaysExpired, it is identical to 0 and obfuscates the code.
1 parenta3612dd commitc88af7b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

‎cores/esp8266/PolledTimeout.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ class timeoutTemplate
146146
using timeType =typename TimePolicyT::timeType;
147147
static_assert(std::is_unsigned<timeType>::value ==true,"timeType must be unsigned");
148148

149-
staticconstexpr timeType alwaysExpired =0;
150149
staticconstexpr timeType neverExpires = std::numeric_limits<timeType>::max();
151150
staticconstexpr timeType rangeCompensate = TimePolicyT::rangeCompensate;//debug
152151

@@ -177,7 +176,7 @@ class timeoutTemplate
177176

178177
boolcanWait ()const
179178
{
180-
return _timeout !=alwaysExpired && !_oneShotExpired;
179+
return _timeout !=0 && !_oneShotExpired;
181180
}
182181

183182
// Resets, will trigger after this new timeout.
@@ -216,7 +215,7 @@ class timeoutTemplate
216215

217216
voidresetToNeverExpires ()
218217
{
219-
_timeout =alwaysExpired +1;// because canWait() has precedence
218+
_timeout =1;// because canWait() has precedence
220219
_neverExpires =true;
221220
}
222221

‎cores/esp8266/Stream.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Stream: public Print {
172172

173173
// transfers already buffered / immediately available data (no timeout)
174174
// returns number of transferred bytes
175-
[[deprecated]]size_tsendAvailable (Print* to) {returnsendGeneric(to, -1, -1,oneShotMs::alwaysExpired); }
175+
[[deprecated]]size_tsendAvailable (Print* to) {returnsendGeneric(to, -1, -1,0); }
176176
[[deprecated]]size_tsendAvailable (Print& to) {returnsendAvailable(&to); }
177177

178178
// transfers data until timeout

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp