The particle swarm optimization (PSO) is apt to cause premature convergence for boundary-constrained optimization problems. To solve this problem, two drawbacks in the invisible wall (IW) widely employed in PSO were discovered: the best particles in neighborhoods and the other particles have distinct opportunities to be evolved, and many updates of a particle’s position are unnecessary. An improved IW (IIW) was proposed. IIW detects whether or not a particle flies outside the allowable solution space in each dimension. If a dimension of the particle is out of the space, it will be updated immediately. Experiments were conducted in several boundary conditions and in different dimensionality, and the results showed that IIW performed more effectively than IW.