Skip to content

dead code in spiffs_api.h #2597

Closed
Closed
@everslick

Description

@everslick

actually not dead, but redundant.

bool seek(uint32_t pos, SeekMode mode) override
{
    CHECKFD();

    int32_t offset = static_cast<int32_t>(pos);
    if (mode == SeekEnd) {
        offset = -offset;
    }
    auto rc = SPIFFS_lseek(_fs->getFs(), _fd, pos, (int) mode);
    if (rc < 0) {
        DEBUGV("SPIFFS_lseek rc=%d\r\n", rc);
        return false;
    }

    return true;
}

int32_t offset is calculated but not used afterwards. maybe the idea was to use offset instead of pos in lseek?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions