インライン if とコメントを含む追加行

インライン if とコメントを含む追加行

algorithm2e を使ってアルゴリズムを書いています。

\lIfと同じ行にコメントを付けて、インライン if を実行したいと思います\Comment*

\documentclass{article}

\usepackage[vlined,boxed,linesnumbered]{algorithm2e}
\DontPrintSemicolon
\SetKwIF{If}{ElseIf}{Else}{if}{then}{else if}{else}{}
\SetKwComment{Comment}{}{}

\begin{document}

\begin{algorithm}[ht]
\lIf{true}{%
    foo \Comment*{bar}
}
\caption{Test}
\end{algorithm}

\end{document}

しかし、余分な不要な行が生成されます。

どうやって削除するのですか?

関連情報