Repository: pixijs/pixijs
File: src/filters/FilterSystem.ts (TypeScript)

Code before:
     * @param instruction - The instruction containing the filter effect and container.
     * @internal
     */
    public push(instruction: FilterInstruction)
    {
        const renderer = this.renderer;

        const filters = instruction.filterEffect.filters;

        // get a filter data from the stack. They can be reused multiple times each frame,
        // so we don't need to worry about overwriting them in a single pass.
        const filterData = this._pushFilterData();

        filterData.skip = false;

        filterData.filters = filters as Filter[];
        filterData.container = instruction.container;
        filterData.outputRenderSurface = renderer.renderTarget.renderSurface;

        const colorTextureSource = renderer.renderTarget.renderTarget.colorTexture.source;

        const rootResolution = colorTextureSource.resolution;
        const rootAntialias = colorTextureSource.antialias;

        // if there are no filters, or all of them disabled, we skip the pass
        if (filters.length === 0 || filters.every((filter) => !filter.enabled))
        {
            filterData.skip = true;

            return;
        }

        const bounds = filterData.bounds;

        this._calculateFilterArea(instruction, bounds);

        this._calculateFilterBounds(filterData, renderer.renderTarget.rootViewPort, rootAntialias, rootResolution, 1);

        if (filterData.skip)
        {
            return;
        }

        const previousFilterData = this._getPreviousFilterData();

        const globalResolution = this._findFilterResolution(rootResolution);
        let offsetX = 0;
        let offsetY = 0;

        if (previousFilterData)
        {

Review comment (suggestion):
The behavior when an empty array and `every` is always to return `true`, so I think we can remove that condition.
```suggestion
        if (filters.every((filter) => !filter.enabled))
```

Code after:
     * @param instruction - The instruction containing the filter effect and container.
     * @internal
     */
    public push(instruction: FilterInstruction)
    {
        const renderer = this.renderer;

        const filters = instruction.filterEffect.filters;

        // get a filter data from the stack. They can be reused multiple times each frame,
        // so we don't need to worry about overwriting them in a single pass.
        const filterData = this._pushFilterData();

        filterData.skip = false;

        filterData.filters = filters as Filter[];
        filterData.container = instruction.container;
        filterData.outputRenderSurface = renderer.renderTarget.renderSurface;

        const colorTextureSource = renderer.renderTarget.renderTarget.colorTexture.source;

        const rootResolution = colorTextureSource.resolution;
        const rootAntialias = colorTextureSource.antialias;

        // if there are no filters, or all of them disabled, we skip the pass
        if (filters.every((filter) => !filter.enabled))
        {
            filterData.skip = true;

            return;
        }

        const bounds = filterData.bounds;

        this._calculateFilterArea(instruction, bounds);

        this._calculateFilterBounds(filterData, renderer.renderTarget.rootViewPort, rootAntialias, rootResolution, 1);

        if (filterData.skip)
        {
            return;
        }

        const previousFilterData = this._getPreviousFilterData();

        const globalResolution = this._findFilterResolution(rootResolution);
        let offsetX = 0;
        let offsetY = 0;

        if (previousFilterData)
        {