It is, but it could be clearer, as it’s not particularly direct about it:
All recursive directory iterators must inspect the entry’s type. Therefore, the value is stored and its access is guaranteed to be cheap and successful.
When you walk a directory recursively, you have to inspect the entry’s type to determine whether it’s a directory or not. Therefore, since that information is already available, walkdir can provide it to the caller as is without another stat call.